AdminUiConfig

AdminUiConfig

AdminUiConfig

This interface describes JSON config file (vendure-ui-config.json) used by the Admin UI. The values are loaded at run-time by the Admin UI app, and allow core configuration to be managed without the need to re-build the application.

Signature

interface AdminUiConfig {
  apiHost: string | 'auto';
  apiPort: number | 'auto';
  adminApiPath: string;
  tokenMethod: 'cookie' | 'bearer';
  authTokenHeaderKey: string;
  defaultLanguage: LanguageCode;
  availableLanguages: LanguageCode[];
}

Members

apiHost

property
type:
string | 'auto'
default:
'http://localhost'
The hostname of the Vendure server which the admin ui will be making API calls to. If set to “auto”, the Admin UI app will determine the hostname from the current location (i.e. window.location.hostname).

apiPort

property
type:
number | 'auto'
default:
3000
The port of the Vendure server which the admin ui will be making API calls to. If set to “auto”, the Admin UI app will determine the port from the current location (i.e. window.location.port).

adminApiPath

property
type:
string
default:
'admin-api'
The path to the GraphQL Admin API.

tokenMethod

property
type:
'cookie' | 'bearer'
default:
'cookie'
Whether to use cookies or bearer tokens to track sessions. Should match the setting of in the server’s tokenMethod config option.

authTokenHeaderKey

property
type:
string
default:
'vendure-auth-token'
The header used when using the ‘bearer’ auth method. Should match the setting of the server’s authOptions.authTokenHeaderKey config option.

defaultLanguage

property
type:
LanguageCode
default:
LanguageCode.en
The default language for the Admin UI. Must be one of the items specified in the availableLanguages property.

availableLanguages

property
type:
LanguageCode[]
default:
[LanguageCode.en, LanguageCode.es]
An array of languages for which translations exist for the Admin UI.