Skip to main content
All Web SDK methods for SMS require you to initiate an action first. Check out our guide on SMS authentication for more details.

Enroll

Start enrollment for a new SMS OTP authenticator by sending the user an SMS containing an OTP code. This method is typically used when you’ve not yet verified the user’s phone number.
const response = await authsignal.sms.enroll({ phoneNumber: "+64270000000" });
If you’ve already verified a user’s phone number independently of Authsignal, you can alternatively use a Server SDK to enroll the user programmatically.

Parameters

phoneNumber
string
The user’s phone number in E.164 format e.g. +14155552671.

Response

response
AuthsignalResponse<EnrollResponse>

Challenge

Start re-authentication for an existing SMS authenticator by sending the user an SMS containing an OTP code. This method is typically used when you’ve already verified the user’s phone number.
const response = await authsignal.sms.challenge();

Response

response
AuthsignalResponse<ChallengeResponse>

Verify

Finish enrolling or re-authenticating a new or existing SMS OTP authenticator by verifying the code submitted by the user.
const response = await authsignal.sms.verify({ code: "123456" });

Parameters

code
string
The OTP code inputted by the user.

Response

response
AuthsignalResponse<VerifyResponse>
data
VerifyResponse