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.

💡 Use phone auth carefully

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

  1. Go to the Supabase Dashboard
  2. Select your project.
  3. Go to project settings
  4. Go to the Authentication configuration section.
  5. General user signup
  6. 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.