VendureConfig

VendureConfig

Documentation generated from vendure-config.ts on Feb 19 2019 at 16:20

All possible configuration options are defined by the VendureConfig interface.

Note on terminology: many of the configuration properties are named “Strategy” - this is because their use follows the Strategy Pattern of software design.

Signature

interface VendureConfig {
  apiPath?: string;
  assetOptions?: AssetOptions;
  authOptions: AuthOptions;
  channelTokenKey?: string;
  cors?: boolean | CorsOptions;
  customFields?: CustomFields;
  dbConnectionOptions: ConnectionOptions;
  defaultChannelToken?: string | null;
  defaultLanguageCode?: LanguageCode;
  emailOptions?: EmailOptions<any>;
  entityIdStrategy?: EntityIdStrategy<any>;
  hostname?: string;
  importExportOptions?: ImportExportOptions;
  orderMergeOptions?: OrderMergeOptions;
  orderProcessOptions?: OrderProcessOptions<any>;
  middleware?: Array<{ handler: RequestHandler; route: string }>;
  paymentOptions: PaymentOptions;
  plugins?: VendurePlugin[];
  port: number;
  promotionOptions?: PromotionOptions;
  shippingOptions?: ShippingOptions;
  silent?: boolean;
  taxOptions?: TaxOptions;
}

Members

apiPath

property
type:
string
default:
'api'

The path to the GraphQL API.

assetOptions

property
type:
AssetOptions

Configuration for the handling of Assets.

authOptions

property
type:
AuthOptions

Configuration for authorization.

channelTokenKey

property
type:
string
default:
'vendure-token'

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.

cors

property
type:
boolean | CorsOptions
default:
{ origin: true, credentials: true }

Set the CORS handling for the server. See the express CORS docs.

customFields

property
type:
CustomFields
default:
{}

Defines custom fields which can be used to extend the built-in entities.

dbConnectionOptions

property
type:
ConnectionOptions

The connection options used by TypeORM to connect to the database.

defaultChannelToken

property
type:
string | null
default:
null

The token for the default channel. If not specified, a token will be randomly generated.

defaultLanguageCode

property
type:
LanguageCode
default:
LanguageCode.en

The default languageCode of the app.

emailOptions

property
type:
EmailOptions<any>

Configures the handling of transactional emails.

entityIdStrategy

property
type:
EntityIdStrategy<any>
default:
new AutoIncrementIdStrategy()

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.

hostname

property
type:
string
default:
''

Set the hostname of the server. If not set, the server will be available on localhost.

importExportOptions

property

Configuration settings for data import and export.

orderMergeOptions

property

Define the strategies governing how Orders are merged when an existing Customer signs in.

orderProcessOptions

property
type:
OrderProcessOptions<any>

Defines custom states in the order process finite state machine.

middleware

property
type:
Array<{ handler: RequestHandler; route: string }>
default:
[]

Custom Express middleware for the server.

paymentOptions

property

Configures available payment processing methods.

plugins

property
type:
VendurePlugin[]
default:
[]

An array of plugins.

port

property
type:
number
default:
3000

Which port the Vendure server should listen on.

promotionOptions

property

Configures the Conditions and Actions available when creating Promotions.

shippingOptions

property

Configures the available checkers and calculators for ShippingMethods.

silent

property
type:
boolean
default:
false

When set to true, no application logging will be output to the console.

taxOptions

property
type:
TaxOptions

Configures how taxes are calculated on products.

alpha