Setup OTP
Firebase Setup
To use OTP with Firebase as your provider, follow these steps:
- Go to your firebase console.
- Go to the
Authenticationsection. - Enable the
Phone Numberauthentication.
Supabase Setup
To use Supabase as your provider, follow these steps:
- Go to the supabase dashboard of your project.
- Go to the
Authenticationsection. - Click on the providers options.
- Enable the
Phone Numberauthentication. - 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_TOKENandTWILIO_VERIFY_SERVICE_SIDprovided 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_TOKENandVERIFY_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.