@salesforce/b2c-tooling-sdk / clients / createPreferencesClient
Function: createPreferencesClient()
createPreferencesClient(
config,auth,options?):PreferencesClient
Defined in: packages/b2c-tooling-sdk/src/clients/preferences.ts:99
Creates a typed Preferences API client.
Authentication is handled by middleware. The client automatically attaches:
- Domain scope:
sfcc.preferences(read) orsfcc.preferences.rw(read-write) - Tenant scope:
SALESFORCE_COMMERCE_API:{tenantId}
Parameters
config
auth
options?
Returns
Example
typescript
const client = createPreferencesClient(
{shortCode: 'kv7kzm78', tenantId: 'zzxy_prd'},
oauthStrategy,
);
const {data} = await client.GET('/organizations/{organizationId}/global-custom-preferences', {
params: {path: {organizationId: toOrganizationId('zzxy_prd')}},
});