Skip to content

Class: TSAccountProtection

Constructors

constructor

new TSAccountProtection(clientId, options?)

Creates a new Account Protection SDK instance with your client context

Parameters

NameTypeDescription
clientIdstringYour AccountProtection client identifier
options?ConstructorOptionsSDK configuration options

Methods

init

init(options?): Promise<boolean>

Initializes the AccountProtection SDK, which starts automatically tracking and submitting info of the user journey

Parameters

NameTypeDescription
options?string | InitOptionsInit options

Returns

Promise<boolean>

Indicates if the call succeeded


triggerActionEvent

triggerActionEvent(actionType, options?): Promise<ActionResponse>

Reports a user action event to the SDK

Parameters

NameTypeDescription
actionTypestringType of user action event that was predefined in the Mosaic server
optionsActionEventOptions-

Returns

Promise<ActionResponse>

Indicates if the call succeeded


setAuthenticatedUser

setAuthenticatedUser(userId, options?): Promise<boolean>

Sets the user context for all subsequent events in the browser session (or until the user is explicitly cleared) It should be set only after you've fully authenticated the user (including, for example, any 2FA that was required)

Parameters

NameTypeDescription
userIdstringOpaque identifier of the user in your system
optionsObjectReserved for future use

Returns

Promise<boolean>

Indicates if the call succeeded


clearUser

clearUser(options?): Promise<boolean>

Clears the user context for all subsequent events in the browser session

Parameters

NameTypeDescription
optionsObjectReserved for future use

Returns

Promise<boolean>

Indicates if the call succeeded