Phone OTP Auth in Flutter with Supabase: SMS Login That Actually Works
Add passwordless phone login to your Flutter app with Supabase: Twilio SMS setup in the dashboard, signInWithOtp and verifyOTP in Dart, WhatsApp OTP channel — plus the E.164, cost, rate-limit, and testing gotchas that break most implementations.
TL;DR: Supabase supports passwordless phone login via SMS OTP, but it doesn't send the SMS itself — you connect a Twilio account (Message Service SID) in the dashboard, then call signInWithOtp(phone: ...) to send the code and verifyOTP(phone: ..., token: ..., type: OtpType.sms) to verify it in Flutter. Use E.164 formatting ( +92... ), handle OTP expiry and resends, and test with Twilio test credentials before spending real money. This guide covers the full setup plus the cost and rate-limit realities nobody puts in the thumbnail. What you'll learn How Supabase phone auth works (and what Supabase does vs what Twilio does) Connecting Twilio in the Supabase dashboard The Flutter flow: send OTP → verify OTP, with Dart code WhatsApp as an OTP channel The gotchas: E.164 formatting, costs, rate limits, expiry, testing How it fits together Supabase Auth manages the OTP lifecycle — generating codes, expiry, verification, and sessions. But Supabase is not an SMS carrier: the actual text message goes out through Twilio (or another SMS provider you wire up). Your Flutter app only ever talks to Supabase; Supabase talks to Twilio behind the scenes. That split explains most confusion: "phone auth" configuration lives in two places — the SMS provider credentials in the Supabase dashboard, and the OTP API calls in your Dart code. Step 1: Set up Twilio Create a Twilio account and get a phone number (or use a Messaging Service). Create a Messaging Service in the Twilio console and add your sender number to it — Supabase needs the Message Service SID (starts with MG... ), not just the account SID. In the Supabase dashboard: Authentication → Providers → Phone → enable it, then enter your Twilio Account SID , Auth Token , and Message Service SID . For development, Twilio provides…