@salesforce/b2c-tooling-sdk / operations/ods / buildSandboxSettings
Function: buildSandboxSettings()
buildSandboxSettings(
options): { } |undefined
Defined in: packages/b2c-tooling-sdk/src/operations/ods/sandbox-settings.ts:71
Builds the sandbox settings object granting OCAPI and WebDAV permissions to a client ID. New sandboxes have no API permissions by default, so the client used to create the sandbox (e.g. for code deployment) must be granted access explicitly or subsequent operations will fail with authorization errors.
When ocapiSettings/webdavSettings are provided they fully replace the defaults. Otherwise, when a clientId is provided, the client is granted the default resources/permissions.
Parameters
options
Returns
{ } | undefined
The settings object, or undefined when there is nothing to set (no client ID and no custom settings).
Example
const settings = buildSandboxSettings({clientId: config.values.clientId});
await odsClient.POST('/sandboxes', {body: {realm, ttl, settings}});