Configuration
To connect your Archibald application with SAP Commerce, you need to provide the connection details in your environment configuration files.
Environment Configuration
The SAP Commerce configuration is typically located in the environment directory of your application template (e.g., templates/shop/environment/common.ts).
Here is an example of the SAP Commerce configuration:
// templates/shop/environment/common.ts
export default defineCommonConfig<ProjectConfig>({
// ...
hybris: {
api: {
schema: '/{base}/{version}/{baseSite}/{url}',
protocol: '{{HYBRIS_PROTOCOL|http}}',
host: '{{HYBRIS_HOST|localhost}}',
port: '{{HYBRIS_PORT|9001}}',
version: 'v2',
// should be same for all environments
base: 'rest',
retry: {
times: 1,
delay: 100
},
// mock the requests inside archibald instead of going to hybris
mocked: true
},
smartedit: {
authorizedUrls: ['localhost:9002']
},
oauth: {
client_id: 'admin_static',
client_secret: 'nimda'
}
},
// ...
});
Configuration Options
api.schema: The URL schema for OCC requests. The{base},{version},{baseSite}and{url}placeholders are resolved from the other config values and the requested resource (e.g.,/rest/v2/{baseSite}/{url}).api.protocol: The protocol used to connect to the SAP Commerce OCC APIs (e.g.,httporhttps).api.host: The hostname of your SAP Commerce instance.api.port: The port of your SAP Commerce instance.api.version: The OCC API version (e.g.,v2), inserted into the schema's{version}placeholder.api.base: The base path segment for the SAP Commerce OCC APIs (e.g.,rest), inserted into the schema's{base}placeholder.api.retry: Retry behavior for failed OCC requests (timesanddelayin milliseconds).api.mocked: Iftrue, requests are mocked inside Archibald instead of being sent to SAP Commerce.smartedit.authorizedUrls: A list of authorized URLs for SmartEdit integration.oauth.client_id: Your SAP Commerce OAuth client ID.oauth.client_secret: Your SAP Commerce OAuth client secret.
These values are typically provided through environment variables at build time.