All TOTP SDK methods require you to initiate an action first.
Enroll
Start enrollment for a new TOTP authenticator by generating a QR code to display to the user.Copy
Ask AI
const response = await authsignal.totp.enroll();
Response
Show properties
Show properties
An unstructured error description present if the SDK call encountered an error.
Show properties
Show properties
Verify
Finish enrolling or re-authenticating a TOTP authenticator by verifying the code submitted by the user.Copy
Ask AI
const response = await authsignal.totp.verify({ code: "123456" });
Parameters
The OTP code inputted by the user.
Response
Show properties
Show properties
An unstructured error description present if the SDK call encountered an error.
Show properties
Show properties
True if the verification was successful.
A token which can be used for server-side
validation.
Only present on first time verification e.g. enrollment.
Show properties
Show properties
The ID of the Authsignal user authenticator.
verificationMethod
'SMS' | 'AUTHENTICATOR_APP' | 'EMAIL_MAGIC_LINK' | 'EMAIL_OTP' | 'PASSKEY' | 'PUSH' | 'SECURITY_KEY' | 'VERIFF' | 'IPROOV' | 'IDVERSE' | 'PALM_BIOMETRICS_BR'
required
The date and time the authenticator was created in ISO 8601 format.
The date and time the authenticator was first verified in ISO 8601 format.
The date and time the authenticator was last verified in ISO 8601 format.
Whether the authenticator is the default authenticator for the user.
The email address of the authenticator. Only present for email authenticators e.g. email OTP and email magic link.
The phone number of the authenticator. Only present for phone authenticators e.g. SMS/WhatsApp OTP.
The previous SMS channel used to send the OTP code. Only present for phone authenticators e.g. SMS/WhatsApp OTP.
Only present for passkey authenticators.
Show properties
Show properties
The ID of the passkey credential.
The device ID of the passkey credential.
The name of the passkey credential.
The AAGUID of the passkey credential.
Whether the passkey credential is backed up.
The device type of the passkey credential.
The parsed user agent of the passkey credential.
Show properties
Show properties
The user agent of the passkey credential.
The date and time the passkey credential was verified in ISO 8601 format.
The authenticator attachment of the passkey credential.
A structured code present if the verification failed due to user error. Possible values are:
CODE_INVALID_OR_EXPIRED or MAX_ATTEMPTS_EXCEEDED.
