VendureConfig

VendureConfig

All possible configuration options are defined by the VendureConfig interface.

Signature

interface VendureConfig {
  adminApiPath?: string;
  shopApiPath?: string;
  assetOptions?: AssetOptions;
  authOptions: AuthOptions;
  channelTokenKey?: string;
  cors?: boolean | CorsOptions;
  customFields?: CustomFields;
  dbConnectionOptions: ConnectionOptions;
  defaultChannelToken?: string | null;
  defaultLanguageCode?: LanguageCode;
  entityIdStrategy?: EntityIdStrategy<any>;
  hostname?: string;
  importExportOptions?: ImportExportOptions;
  orderOptions?: OrderOptions;
  middleware?: Array<{ handler: RequestHandler; route: string }>;
  paymentOptions: PaymentOptions;
  plugins?: VendurePlugin[];
  port: number;
  promotionOptions?: PromotionOptions;
  shippingOptions?: ShippingOptions;
  logger?: VendureLogger;
  taxOptions?: TaxOptions;
}

Members

adminApiPath

property
type:
string
default:
'admin-api'

The path to the admin GraphQL API.

shopApiPath

property
type:
string
default:
'shop-api'

The path to the admin 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.

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.

orderOptions

property
type:
OrderOptions

Configuration settings governing how orders are handled.

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.

logger

property
default:
DefaultLogger

Provide a logging service which implements the VendureLogger interface.

taxOptions

property
type:
TaxOptions

Configures how taxes are calculated on products.