1

I'm trying to get a locally started Supabase instance to support phone authentication. I started Supabase using the CLI: supabase start

I didn't find anything phone/sms/otp related in the CLI config documentation: https://supabase.com/docs/reference/cli/config

But something is mentioned in the GoTrue GitHub repo: https://github.com/supabase/gotrue

So I tried setting the following env vars to enable phone OTPs

$ export GOTRUE_EXTERNAL_PHONE_ENABLED=true
$ export GOTRUE_SMS_PROVIDER=messagebird
$ export GOTRUE_SMS_MESSAGEBIRD_ACCESS_KEY=...
$ export GOTRUE_SMS_MESSAGEBIRD_ORIGINATOR=localdev
$ supabase start
...
Started supabase local development setup.
...

But when I calling signInWithOtp(phone: phoneNumber) from my Flutter App I get the following exception: Error sending sms: sms Provider could not be found, statusCode: 400

E/flutter (22321): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: Error sending sms: sms Provider  could not be found, statusCode: 400)
E/flutter (22321): #0      GotrueFetch.request (package:gotrue/src/fetch.dart:99:7)
E/flutter (22321): <asynchronous suspension>
E/flutter (22321): #1      GoTrueClient.signInWithOtp (package:gotrue/src/gotrue_client.dart:270:7)
E/flutter (22321): <asynchronous suspension>

Is this supported at all when launching Supabase via CLI? If so, how to properly configure it?

Ranil Wijeyratne
  • 626
  • 7
  • 19
  • Where did you set the `GOTRUE_EXTERNAL_PHONE_ENABLED` and other env variables? – dshukertjr Feb 08 '23 at 04:31
  • like listed above... exported them in my shell and then called `supabase start`... made it more obvious in my question. Is there another way I need to pass the variable? – Ranil Wijeyratne Feb 09 '23 at 17:16
  • 1
    At the moment it doesn't look like phone auth is supported in local supabase. But hopefully it will soon in the future. – Andrew Smith Feb 11 '23 at 18:36
  • Is it still the case that phone auth isn't supported in local supabase? Couldn't find any info about it – cdimitroulas May 03 '23 at 17:01

0 Answers0