Follow this guide to sign in users with a phone number (SMS).
You need a Twilio account to use this feature because all SMS are sent through Twilio.
Enable the Phone Number (SMS) sign-in method in the Nhost dashboard under Settings -> Sign-In Methods -> Phone Number (SMS).
You need to insert the following settings in the Nhost dashboard from Twilio:
- Account SID
- Auth Token
- Messaging Service SID (or a Twilio phone number)
To sign in users with a phone number is a two-step process:
- Send a one-time password (OTP) to the user's phone number.
- The user uses the OTP to sign in.
// Step 1: Send OTP to the user's phone number
// Step 2: Sign in user using their phone number and OTP
The first time a user signs in using a phone number, the user is created. That means you don't need to sign up users before signing in users.
Phone numbers should start with
00) to follow the E.164 formatting standard.
Other SMS Providers
We only support Twilio for now. If you want support for another SMS provider, please create an issue on GitHub.