---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../modules.md) / [clients](../index.md) / createPreferencesClient

# Function: createPreferencesClient()

> **createPreferencesClient**(`config`, `auth`, `options?`): [`PreferencesClient`](../type-aliases/PreferencesClient.md)

Defined in: [packages/b2c-tooling-sdk/src/clients/preferences.ts:99](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/clients/preferences.ts#L99)

Creates a typed Preferences API client.

Authentication is handled by middleware. The client automatically attaches:
- Domain scope: `sfcc.preferences` (read) or `sfcc.preferences.rw` (read-write)
- Tenant scope: `SALESFORCE_COMMERCE_API:{tenantId}`

## Parameters

### config

[`PreferencesClientConfig`](../interfaces/PreferencesClientConfig.md)

### auth

[`AuthStrategy`](../../auth/interfaces/AuthStrategy.md)

### options?

[`PreferencesClientOptions`](../interfaces/PreferencesClientOptions.md)

## Returns

[`PreferencesClient`](../type-aliases/PreferencesClient.md)

## 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')}},
});
```
