Supabase cli start with phone authentication provider

319 Views Asked by At

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?

0

There are 0 best solutions below