Skip to content
View as Markdown
View as Markdown

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

Function: withScopes()

withScopes(auth, additionalScopes): AuthStrategy

Defined in: packages/b2c-tooling-sdk/src/clients/scapi-backend-utils.ts:66

Returns a copy of auth with additionalScopes merged in, or the original auth if the strategy doesn't support scope merging (e.g., basic/api-key auth, or a stored-session strategy where scopes were fixed at acquisition).

Centralized so SCAPI client factories don't have to keep extending an instanceof chain as new OAuth strategy types are added.

Parameters

auth

AuthStrategy

additionalScopes

string[]

Returns

AuthStrategy

Released under the Apache-2.0 License.