Project configuration
The environment folder contains configuration for each environment in your Archibald project. This folder should be in the root of your Archibald project.
If you created an Archibald project with the npm init @archibald package, there should already be a sample configuration in your project’s directory. By default, the environment folder contains a common.ts file with common configuration that applies to all environments. Additionally, there is a configuration file per environment. E.g., environment folder that is added when using @archibald/bootstrap package to generate a new project.
/
|-- /environment
|-- common.ts
|-- local.ts
Configuration options
DefaultAppConfig
Configuration includes five main parts:
| Property | Type | Description |
|---|---|---|
| general | DefaultGeneralConfig | Defines general purpose configuration. |
| hybris | DefaultHybrisConfig | Defines configuration needed for the communication with SAP commerce. |
| app | DefaultAppConfig | Defines client configuration. |
| server | DefaultServerConfig | Defines server configuration. |
| tenants | DefaultTenantsConfig | Defines platform/tenant configuration. This configuration can be used to override the configuration defined in the app property. |
general
DefaultGeneralConfig
Representation of general purpose configuration.
| Property | Type | Description |
|---|---|---|
| useSecureCookies | boolean | Defines if server side cookies should be secure or not. ** |
| memwatch | DefaultMemWatchConfig | Defines configuration that is used to detect and find memory leaks in Node.JS code. |
memwatch
DefaultMemWatchConfig
Representation of configuration that is used to detect and find memory leaks in Node.JS code.
| Property | Type | Description |
|---|---|---|
| active | DefaultMemWatchActivation | Defines status of memwatch instance. DefaultMemWatchActivation enum is used with following values:
|
| boolean | Defines whether memwatch info should be printed or not. |
hybris
DefaultHybrisConfig
Representation of configuration needed for the communication with SAP commerce.
| Property | Type | Description |
|---|---|---|
| api | DefaultApiConfig | Defines SAP commerce api configuration. |
| oauth | DefaultOAuthCredentials | OAuth client used by the commerce auth providers: client_id, client_secret, plus optional keys such as scope and redirect_uri for the OIDC login flow. |
app
DefaultAppConfig
Representation of client configuration.
| Property | Type | Description |
|---|---|---|
| logLevel | LogLevel | Defines log level that should be used for logging. LogLevel enum is used with following values:
|
| supportedLanguages | unknown[] | Defines a list of supported languages. Typing of this property is overridden in a project. |
| defaultLanguage | unknown | Defines the default language. Typing of this property is overridden in a project. Usually the Language enum is used for typing. |
| baseSite | string | Defines base site needed to connect to SAP commerce. |
| canonicalBaseUrl | string | The public base URL of the application. Also used as the JWE token iss claim and as the base for the OIDC redirect_uri. |
| api | DefaultApiConfig | Defines client api configuration. |
| route | object | Defines route configuration. |
| authentication | AuthConfig | Defines authentication configuration. |
authentication
AuthConfig
Controls which login protocols the auth endpoints are registered for (server-side) and accepted from (client-side). See the OIDC Login Flow guide.
| Property | Type | Description |
|---|---|---|
| whitelistedProtocols | AuthProtocol[] ('password' | 'oidc') | Whitelisted authentication protocols. 'password' registers POST auth/login; 'oidc' registers GET auth/login, POST auth/token, and GET auth/callback. |
route
Representation of route configuration.
| Property | Type | Description |
|---|---|---|
| prefix | string | Defines a prefix that will be prepended to every client route. |
server
DefaultServerConfig
Representation of server configuration.
| Property | Type | Description |
|---|---|---|
| cookies | object | Defines how cookies are handled on the server. |
| credentials | object | Defines credentials needed for the authentication with 3rd party systems. |
| git | object | Defines branch/tag and commit hash currently deployed to a system. |
cookies
Representation of configuration towards cookie handling. Mainly used by the CookieDecorator.
| Property | Type | Description |
|---|---|---|
| whitelist | boolean | string[] | true means the CookieDecorator will use the registered cookies from HapiJS, otherwise a list of whitlisted cookies can be provided here directly. |
credentials
Representation of credentials needed for the authentication with 3rd party systems.
| Property | Type | Description |
|---|---|---|
| oauth | object | Defines credentials needed for the OAuth authentication with SAP commerce. |
| token | object | Defines the secrets used to encrypt the JWE session tokens issued by the AuthModule. |
token
Secrets for the encrypted session tokens. Referenced from the AuthModule registration as server.credentials.token.secret.
| Property | Type | Description |
|---|---|---|
| secret | string | Primary JWE encryption secret. Must be exactly 32 characters. |
| secret_rotation | string | Optional secondary secret tried on decryption failure, enabling zero-downtime secret rotation. |
git
Representation of an object that contains branch/tag and commit hash currently deployed to a system.
| Property | Type | Description |
|---|---|---|
| version | string | Defines name of branch/tag. |
| hash | string | Defines commit hash. |
tenants
DefaultTenantsConfig
Representation of platform/tenant configuration. This configuration can be used to override the configuration defined in the app property. E.g. newly created project has the following tenants config:
tenants: {
[Platform.SHOP]: {
[Tenant.NETCONOMY_B2C]: {
app: {}
},
},
}
api
DefaultAppApiConfig
Representation of api configuration for app.
| Property | Type | Description |
|---|---|---|
| protocol | string | Defines protocol used in the request URL. E.g. <protocol>://localhost:3100/jsapi/v2/path |
| host | string | Defines host used in the request URL. E.g. https://<host>:3100/jsapi/v2/path |
| port | string | Defines port used in the request URL. E.g. https://localhost:<port>/jsapi/v2/path |
| base | string | Defines base for request to the server. E.g. https://localhost:3100/<base>/v2/path |
| baseSite | string | Defines base site needed to connect to SAP commerce. |
| useMiddleware | boolean | Defines whether the requests should go against the server or the configured host directly. |
| mocked | boolean | Defines whether the requests are mocked or not. |
| retry | RetryOptions | Defines how many times a request should be resent if it fails and after what time. |
DefaultApiConfig
Representation of an ordinary api configuration without the specifics of the app api config.
| Property | Type | Description |
|---|---|---|
| protocol | string | Defines protocol used in the request URL. E.g. <protocol>://localhost:3100/jsapi/v2/path |
| host | string | Defines host used in the request URL. E.g. https://<host>:3100/jsapi/v2/path |
| port | string | Defines port used in the request URL. E.g. https://localhost:<port>/jsapi/v2/path |
| base | string | Defines base for request to the server. E.g. https://localhost:3100/<base>/v2/path |
| baseSite | string | Defines base site needed to connect to SAP commerce. |
| mocked | boolean | Defines whether the requests are mocked or not. |
| retry | RetryOptions | Defines how many times a request should be resent if it fails and after what time. |
| rejectUnauthorized | boolean | WARNING: This property MUST NOT be set to false for production environments. Defines if a self-signed SSL certificates should be used for the connection to SAP commerce. When set to false the "process.env.NODE_TLS_REJECT_UNAUTHORIZED" property will be set to "0". This will disable certificate checks for all https client calls and hence is not secured. |
retry
Defines how many times a request should be resent if it fails. It also defines initial delay time.
| Property | Type | Description |
|---|---|---|
| times | number | Defines how many times a request should be resent if it fails |
| delay | number | Defines the first wait time to delay. Each retry doubles the current delay. |