title: "Configuration"
All configuration and customization of Vendure is done via the VendureConfig object which gets passed to the bootstrap function:
bootstrap({
defaultChannelToken: 'default-channel',
authOptions: {
sessionSecret: 'xup1hki5zo',
},
port: 3000,
apiPath: 'api',
dbConnectionOptions: {
type: 'mysql',
database: 'vendure-dev',
host: '192.168.99.100',
port: 3306,
username: 'root',
password: '',
},
paymentOptions: {
paymentMethodHandlers: [examplePaymentHandler],
},
customFields: {},
importExportOptions: {
importAssetsDir: path.join(__dirname, 'vendure/import-assets'),
},
plugins: [
new DefaultAssetServerPlugin({
route: 'assets',
assetUploadDir: path.join(__dirname, 'vendure/assets'),
port: 4000,
}),
new DefaultEmailPlugin({
templatePath: path.join(__dirname, 'vendure/email/templates'),
devMode: true,
}),
new DefaultSearchPlugin(),
],
}).catch(err => {
console.log(err);
});
VendureConfig interfaceAll possible configuration options are defined by the VendureConfig interface.
{{% alert %}} Note on terminology: many of the configuration properties are named "Strategy" - this is because their use follows the Strategy Pattern of software design. {{% /alert %}}
The path to the GraphQL API.
Configuration for the handling of Assets (images and other files). See assetOptions.
Configuration for authorization and authentication. See authOptions.
The name of the property which contains the token of the active channel. This property can be included either in the request header or as a query string.
Set the CORS handling for the server. See the Express cors docs
Defines custom fields which can be used to extend the built-in entities. See customFields.
The connection options used by TypeORM to connect to the database. See the TypeORM connection options docs.
The token for the default channel. If not specified, a token will be randomly generated.
The default ISO 639-1 language code of the server.
Configures the handling of transactional emails. See emailOptions.
Defines the strategy used for both storing the primary keys of entities in the database, and the encoding & decoding of those ids when exposing entities via the API. The default uses a simple auto-increment integer strategy.
Set the hostname of the server.
Configuration settings for data import and export.
Define the strategies governing how Orders are merged when an existing Customer signs in.
Defines custom states in the order process finite state machine. See orderProcessOptions.
Defines custom Express middleware to use for incoming API requests.
Configures available payment processing methods. See paymentOptions.
Configure the active Vendure plugins. See plugins.
Which port the Vendure server should listen on.
Configures the Conditions and Actions available when creating Promotions. See promotionOptions.
Configures the available checkers and calculators for ShippingMethods. See shippingOptions.
When set to true, no application logging will be output to the console.
Configures how taxes are calculated on products. See taxOptions.