This page documents phone authentication settings for apps using the built-in backend (Cloud). Projects connected to your own Supabase project manage authentication in Supabase instead. For an overview of all sign-in methods and user management, see Users and authentication.
Why use phone sign-in
- Works for audiences where email is uncommon or rarely checked
- Suits mobile-first products where typing a phone number is natural
- No passwords to create, forget, or reset
- The phone number doubles as a verified contact channel for your app
Common use cases
Phone sign-in is commonly used for:- Marketplace and delivery apps where sellers and couriers coordinate by phone
- Local-services and booking apps with walk-in customers
- Apps for regions where phone numbers are the primary online identity
- Internal field tools for staff without company email addresses
Set up phone sign-in
1
Create an account with an SMS provider
Phone sign-in requires an account with one of the supported providers. Create one and collect its credentials from the provider’s console:
Pick a provider based on pricing and delivery coverage in the countries where your users are.
2
Enable and configure phone sign-in in Lovable
Go to Cloud tab → Users → Auth settings → Phone, turn on Enable phone sign-in, select your Active SMS provider, and enter its credentials.
3
Add the sign-in flow to your app
Ask Lovable to build the phone sign-in UI:
4
Test the flow
Sign in with a real phone number and verify that the code arrives, the code screen accepts it, and the new user appears in Cloud tab → Users.
Configuration
These settings control the sign-in flow:- SMS template: the message text sent to users. Use
{{ .Code }}where the one-time code should appear. - SMS OTP expiration (seconds): how long a code stays valid, from 60 to 600 seconds.
- SMS OTP length: 4 to 8 digits.
- Auto-confirm SMS: sign users in without OTP verification. Useful while testing, but leave it off in production, since it removes the proof that the user owns the phone number.
Costs
Lovable does not charge for SMS delivery. Your SMS provider bills your account directly for every message sent, at the provider’s own rates. High signup volume means high SMS volume, so keep an eye on your provider’s usage dashboard as your app grows.Troubleshooting
Sign-in codes are not arriving
Sign-in codes are not arriving
Check your SMS provider’s dashboard first: failed deliveries, an exhausted balance, or sender restrictions in the recipient’s country (rules about which names or numbers are allowed to appear as the SMS sender) show up there. Also confirm the provider credentials in your auth settings are current.
Codes arrive but are rejected
Codes arrive but are rejected
The code may be expiring before users can type it. Raise SMS OTP expiration (seconds) in the phone settings, and confirm users are entering the most recent code, since re-requesting a code invalidates earlier ones.
Delivery works in one country but not another
Delivery works in one country but not another
Countries have different rules about which names or numbers may appear as the SMS sender, and some require senders to be registered in advance. Check your provider’s coverage and compliance documentation for the affected country.
FAQ
Is there a managed option like Google sign-in has?
Is there a managed option like Google sign-in has?
Who pays for the SMS messages?
Who pays for the SMS messages?
Your SMS provider bills you directly for every message sent, under your own Twilio, Vonage, MessageBird, or TextLocal account. Lovable does not charge for SMS delivery.
Which SMS provider should I choose?
Which SMS provider should I choose?
Any supported provider works. Pick based on pricing and delivery coverage in the countries where your users are. Twilio Verify manages the verification message for you, while the other providers send the SMS template you define.
Can users sign in with both email and phone?
Can users sign in with both email and phone?
Does phone sign-in work internationally?
Does phone sign-in work internationally?
Delivery depends on your SMS provider’s coverage and each country’s rules about who may appear as the SMS sender. Check your provider’s coverage documentation for the regions where your users are.