Skip to content

@salesforce/b2c-tooling-sdk / clients / createAccountManagerRolesClient

Function: createAccountManagerRolesClient() ​

createAccountManagerRolesClient(config, auth): AccountManagerRolesClient

Defined in: packages/b2c-tooling-sdk/src/clients/am-api.ts:549

Creates a typed Account Manager Roles API client.

Returns the openapi-fetch client directly, with authentication handled via middleware. This gives full access to all openapi-fetch features with type-safe paths, parameters, and responses.

Parameters ​

config ​

AccountManagerClientConfig

Account Manager Roles client configuration

auth ​

AuthStrategy

Authentication strategy (typically OAuth)

Returns ​

AccountManagerRolesClient

Typed openapi-fetch client

Example ​

ts
// Create Account Manager Roles client with OAuth auth
const oauthStrategy = new OAuthStrategy({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
});

const client = createAccountManagerRolesClient({}, oauthStrategy);

// List roles
const { data, error } = await client.GET('/dw/rest/v1/roles', {
  params: { query: { pageable: { size: 25, page: 0 } } }
});

Released under the Apache-2.0 License.