@salesforce/b2c-tooling-sdk / clients / createAccountManagerClient
Function: createAccountManagerClient()
createAccountManagerClient(
config,auth):AccountManagerClient
Defined in: packages/b2c-tooling-sdk/src/clients/am-api.ts:1353
Creates a unified Account Manager API client.
This client provides direct access to all Account Manager API methods (users, roles, orgs) through a single interface, while internally using separate typed clients for type safety.
Parameters
config
Account Manager client configuration
auth
Authentication strategy (typically OAuth)
Returns
Unified Account Manager client
Example
ts
const oauthStrategy = new OAuthStrategy({
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
});
const client = createAccountManagerClient({}, oauthStrategy);
// Users API
const users = await client.listUsers({ size: 25, page: 0 });
const user = await client.getUser('user-id');
await client.createUser({ mail: 'user@example.com', ... });
// Roles API
const roles = await client.listRoles({ size: 20, page: 0 });
const role = await client.getRole('bm-admin');
// Organizations API
const orgs = await client.listOrgs({ size: 25, page: 0 });
const org = await client.getOrg('org-id');
const auditLogs = await client.getOrgAuditLogs('org-id');