Phone Auth with Textlocal
How to set up and use Mobile OTP with Textlocal and Supabase.
To manage costs related to SMS authentication, consider setting project rate limits and configuring CAPTCHA. For additional cost-control strategies, visit the Production Checklist.
Also check country-specific regulations around sending SMS messages, for example, India's TRAI DLT regulations.
Prerequisites
Before you begin, ensure you have the following:
- A Textlocal account: Sign up for TextLocal to start sending SMS messages.
- A Supabase project: Necessary for SMS authentication integration. Create your project in the Supabase Dashboard.
- A mobile phone: To receive SMS messages and test your setup.
Setting up Textlocal as your SMS provider
To integrate Textlocal with Supabase:
Get a Textlocal API key
- Log into your Textlocal account and go to
Settings
>API Keys
. - Generate a new API Key. Save your new API key in a safe location.
Customize your sender name (Optional)
Textlocal defaults to TXTLCL
as the sender name for all messages. You can customize this to better reflect your brand:
- In your Textlocal dashboard, go to
Settings
>All Settings
>Sender Names
. - Change your sender name.
Configure Supabase
To set up Textlocal as your SMS provider in Supabase, follow these steps:
- In your Supabase Dashboard, go to the Auth Providers section.
- From the list of available authentication providers, select
Phone
. - Toggle
Enable Phone Provider
. - Under
SMS Provider
, selectTextlocal.
- Enter your Textlocal API Key and Sender Name.
- Customize your SMS Message (optional).
Next steps
To implement Phone Login, see the docs on using Phone Login.