• new TSAccountProtection(clientId, options?)
Creates a new Account Protection SDK instance with your client context
| Name | Type | Description |
|---|---|---|
clientId | string | Your AccountProtection client identifier |
options? | ConstructorOptions | SDK configuration options |
▸ init(options?): Promise<boolean>
Initializes the AccountProtection SDK, which starts automatically tracking and submitting info of the user journey
| Name | Type | Description |
|---|---|---|
options? | string | InitOptions | Init options |
Promise<boolean>
Indicates if the call succeeded
▸ triggerActionEvent(actionType, options?): Promise<ActionResponse>
Reports a user action event to the SDK
| Name | Type | Description |
|---|---|---|
actionType | string | Type of user action event that was predefined in the Mosaic server |
options | ActionEventOptions | - |
Promise<ActionResponse>
Indicates if the call succeeded
▸ 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)
| Name | Type | Description |
|---|---|---|
userId | string | Opaque identifier of the user in your system |
options | Object | Reserved for future use |
Promise<boolean>
Indicates if the call succeeded
▸ clearUser(options?): Promise<boolean>
Clears the user context for all subsequent events in the browser session
| Name | Type | Description |
|---|---|---|
options | Object | Reserved for future use |
Promise<boolean>
Indicates if the call succeeded