Node.js
Learn how to use the Authsignal Node.js SDK.
Installation
Initialization
You can find your client or tenant ID in the Authsignal Portal.
You must specify the correct base URL for your tenant’s region.
Region | Base URL |
---|---|
US (Oregon) | https://api.authsignal.com/v1 |
AU (Sydney) | https://au.api.authsignal.com/v1 |
EU (Dublin) | https://eu.api.authsignal.com/v1 |
For example, to set the base URL to use our AU region:
track
track
lets you record actions performed by users and initiate challenges.
Arguments
Returns
validateChallenge
validateChallenge
lets you validate the result of a challenge using the token which is obtained after a redirect (if using the pre-built UI) or returned by a client SDK (if using an embedded flow).
When performing MFA for a user who has already been authenticated by a primary factor (e.g. username & password), it’s important to check the token belongs to that user. The validateChallenge method will do this check if you pass both the token and the userId.
Arguments
Returns
getUser
getUser
retrieves a user and their MFA enrollment status.
Arguments
Returns
getAction
Get detailed information on a tracked action.
Arguments
Returns
enrollVerifiedAuthenticator
enrollVerifiedAuthenticator
can be used to enroll an authenticator on behalf of a user if it has already been verified.