Skip to content

sfcc configuration

Your service's config class extends CommerceCloudConfig with its own variables and loads it once at startup. Loading fails and names the variable when a required one is missing. A secret is removed from process.env once it is read.

import { type EnviConfig, envfield } from "@evolve-framework/config";
import { CommerceCloudConfig } from "@evolve-framework/sfcc";
class Config extends CommerceCloudConfig {
readonly HTTP_PORT = 8080;
config(): EnviConfig {
return { ...super.config(), HTTP_PORT: envfield.number() };
}
}
export const config = new Config();
await config.load();

CommerceCloudConfig

The Salesforce Commerce Cloud instance a service talks to, through a SLAS client. Extend it with the service's own settings.

import { CommerceCloudConfig } from "@evolve-framework/sfcc";
VariableDescription
SFCC_CLIENT_IDrequiredThe SLAS client's id.
SFCC_CLIENT_SECRETrequired · secretThe SLAS client's secret. Removed from the environment once read.
SFCC_SITE_IDrequiredThe storefront site, as Business Manager names it.
SFCC_ORGANIZATION_IDrequiredThe organization id, such as f_ecom_zzzz_001.
SFCC_SHORT_CODErequiredThe short code in the instance's API host.

Every service's variables on one page: Configuration.