Skip to content

tru-ID/supabase-passwordless-authentication

Repository files navigation

SIM Card Based Authentication with Supabase React Native and tru.ID PhoneCheck

Requirements

Getting Started

Clone the starter-files branch via:

git clone -b starter-files --single-branch https://github.com/tru-ID/supabase-passwordless-authentication.git

If you're only interested in the finished code in main then run:

git clone -b main https://github.com/tru-ID/supabase-passwordless-authentication.git

Create a tru.ID Account

Install the tru.ID CLI via:

npm i -g @tru_id/cli

Input your tru.ID credentials which can be found within the tru.ID console

Install the tru.ID CLI development server plugin

Create a new tru.ID project within the root directory via:

tru projects:create rn-supabase-auth --project-dir .

Run the development server, pointing it to the directory containing the newly created project configuration. This will also open up a localtunnel to your development server making it publicly accessible to the Internet so that your mobile phone can access it when only connected to mobile data.

tru server -t

Setting up Supbase

Create or log into a Supabase account

Once logged in, you'll see an interface like below, select "new project":

Empty Supabase Dashboard

You'll be taken to the following page, ensure to input your desired credentials for example:

Create a new project

You'll then be redirected to the dashboard. Once there, click on the user icon on the left or "try auth" button

Newly created project dashboard

When you click that, you'll be taken to the following page. Click the "Settings" option and under "Email auth" , disable "Enable Email Confirmations" as shown below Authentication page

Next, we need to copy our the values of the .env.example to .env:

cp .env.example .env

Replace SUPABASE_URL with the URL value found under "Settings > API > Config > URL" in your project dashboard.

Next, replace SUPABASE_PUBLIC_ANON with the anon public value found under "Settings > API > Project API keys > anon public"

Start the project

To start the project, first install dependencies via:

npm install

Ensure you have a physical device connected and run:

npm run android
#or
npm run ios

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published