Configuration for constructing the {@see CommercetoolsApi} class.

interface CommercetoolsApiConfig {
    clientId: string;
    clientScopes: string[];
    clientSecret: string;
    customerScopes?: string[];
    httpsAgent?: Agent;
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    refreshIfWithinSecs?: number;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy

Properties

clientId: string
clientScopes: string[]
clientSecret: string
customerScopes?: string[]
httpsAgent?: Agent
onAfterResponse?: ((response) => void)

Type declaration

    • (response): void
    • If passed in, will be called once a request has been made and the response received (or error thrown).

      Parameters

      Returns void

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

Type declaration

projectKey: string
refreshIfWithinSecs?: number
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the 'User-Agent' HTTP header, in order to help commercetools identify the source of incoming requests.

timeoutMs?: number

Generated using TypeDoc