Setup OTP
Firebase Setup
To use OTP with Firebase as your provider, follow these steps:
- Go to your firebase console.
- Go to the
Authentication
section. - Enable the
Phone Number
authentication.
Supabase Setup
To use Supabase as your provider, follow these steps:
- Go to the supabase dashboard of your project.
- Go to the
Authentication
section. - Click on the providers options.
- Enable the
Phone Number
authentication. - Use whichever SMS provider you want to use for OTP (Twilio, MessageBird, etc.).
- We recommend using Twilio Verify.
- Add the
TWILIO_ACCOUNT_SID
,TWILIO_AUTH_TOKEN
andTWILIO_VERIFY_SERVICE_SID
provided by the SMS provider to the options provided in the dashboard.
Express-app Setup
To use a custom REST API as your provider, follow these steps:
- Go to the Twilio Verify dashboard.
- Create a new service, and get the credentials i.e.
ACCOUNT_SID
,AUTH_TOKEN
andVERIFY_SERVICE_SID
. - Place these credentials in the env file at
backend/express-js/.env
, following the format specified for REST API.
After setting up the OTP, you can use the sendOTP
function to send OTP to the user’s phone number.
OTP service should now be setup for your app for all providers.