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.const response = await authsignal.totp.enroll();
Response
AuthsignalResponse<EnrollTotpResponse>
Show properties
Show properties
Verify
Finish enrolling or re-authenticating a TOTP authenticator by verifying the code submitted by the user.const response = await authsignal.totp.verify({ code: "123456" });
Parameters
string
The OTP code inputted by the user.
Response
AuthsignalResponse<VerifyResponse>
Show properties
Show properties
VerifyResponse
Show properties
Show properties
boolean
required
True if the verification was successful.
string
A token which can be used for server-side
validation.
object
Only present on first time verification e.g. enrollment.
Show properties
Show properties
string
required
The ID of the Authsignal user authenticator.
'SMS' | 'AUTHENTICATOR_APP' | 'EMAIL_MAGIC_LINK' | 'EMAIL_OTP' | 'PASSKEY' | 'PUSH' | 'SECURITY_KEY' | 'VERIFF' | 'IPROOV' | 'IDVERSE' | 'PALM_BIOMETRICS_BR'
required
string
required
The date and time the authenticator was created in ISO 8601 format.
string
required
The date and time the authenticator was first verified in ISO 8601 format.
string
The date and time the authenticator was last verified in ISO 8601 format.
boolean
required
Whether the authenticator is the default authenticator for the user.
string
The email address of the authenticator. Only present for email authenticators e.g. email OTP and email magic link.
string
The phone number of the authenticator. Only present for phone authenticators e.g. SMS/WhatsApp OTP.
SMS | WHATSAPP
The previous SMS channel used to send the OTP code. Only present for phone authenticators e.g. SMS/WhatsApp OTP.
string
Only present for passkey authenticators.
Show properties
Show properties
string
required
The ID of the passkey credential.
string
required
The device ID of the passkey credential.
string
The name of the passkey credential.
string
The AAGUID of the passkey credential.
boolean
required
Whether the passkey credential is backed up.
'singleDevice' | 'multiDevice'
The device type of the passkey credential.
object
The parsed user agent of the passkey credential.
Show properties
Show properties
string
required
The user agent of the passkey credential.
object
object
object
object
string
required
The date and time the passkey credential was verified in ISO 8601 format.
'platform' | 'cross-platform'
The authenticator attachment of the passkey credential.
string
A structured code present if the verification failed due to user error. Possible values are:
CODE_INVALID_OR_EXPIRED or MAX_ATTEMPTS_EXCEEDED.string
See the Error handling section for more details.
string

