Initialize
Variable: initialize()
initialize: (
initializeParams
) =>void
Initializes the SDK with the provided parameters. This function has to be called before using any other SDK functions, and as the bare minimum, it requires an access token.
Parameters
initializeParams
An object with the parameters to initialize the SDK.
The only required parameter is the accessToken
.
accessToken
: The access token to authenticate the user. This has to be previously generated using the OAuth authentication flow.environment
: Optional parameter to set the SDK’s environment. If not provided, the SDK will default toENVIRONMENTS.PRODUCTION
. UseENVIRONMENTS.STAGING
to set the SDK to staging.branch
: Optional parameter to set the SDK’s branch. This is only relevant when theenvironment
is set to ‘staging’. The possible values areBRANCHES.MASTER
,BRANCHES.SANDBOX
andBRANCHES.QA
. If not provided, the SDK will default toBRANCHES.MASTER
.operationSettings
: Optional settings to configure the SDK’s operations that will be performed after the initialization. This can be also provided when calling the operation functions themselves.uiParentElementId
: The id of the DOM element where the SDK will be rendered.mfaPreference
: The MFA preference to use for the operations. This can be eitherMFA_METHODS.PASSKEY
,MFA_METHODS.PAIRED_DEVICE
orMFA_METHODS.SMS_OTP
. If not provided, the SDK will default toMFA_METHODS.PASSKEY
.
Returns
void
Throws
InvalidParametersError
If the access token is not provided or the specified
parameters don’t comply with the expected format.