Setup Supabase phone authentication on ApparenceKit
This guide will help you to install Supabase phone authentication with our app template. By default the phone authentication is generated with the app template. But before you can authenticate with Supabase phone authentication, you need to do some setup.
Phone Authentication seems the best solution but it needs to be used carefully. In some countries SMS are really expensive and some malicious people exploid that. So carefully check SMS prices on the countries you are targeting. I really advise you to also have a secondary way to authenticate your users. (like emails) so you can switch easily if needed.
Activate Supabase phone authentication
- Go to the Supabase Dashboard
- Select your project.
- Go to project settings
- Go to the Authentication configuration section.
- General user signup
- Enable the Phone sign-in method.
Choose a SMS provider
Supabase is using Twilio by default. But you can also use other providers like MessageBird, Vonage, Textlocal. Without this provider you won't be able to send SMS to your users.
Add a test phone number
You can add a test phone number in the Supabase dashboard to test the phone authentication.
It must be provided like this
[number]=[verification code]
example:
33612345678=123456
Link anonymous user to a phone number
By default if you enable the anonymous authentication mode, we will try to link the anonymous user to the phone number. If the phone number is already used, we will login with the phone number.