Skip to main content
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

response
AuthsignalResponse<EnrollTotpResponse>
data
EnrollTotpResponse

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

code
string
The OTP code inputted by the user.

Response

response
AuthsignalResponse<VerifyResponse>
data
VerifyResponse