Required Environment Variables

After installation, you need to set up your environment variables. Copy the .env.example file to .env and configure the following required variables:

Base Configuration

web/.env
NEXT_PUBLIC_SITE_URL="http://localhost:3000"

Set this to your local development URL. In production, update it to your deployed domain.

Supabase Configuration

web/.env
NEXT_PUBLIC_SUPABASE_ANON_KEY=
NEXT_PUBLIC_SUPABASE_URL=
SUPABASE_SERVICE_ROLE_KEY=

URL Configuration

Live

Set your Site URL to your deployed auth callback URL. https://www.yourdomain.com/auth/callback

Testing

Make sure to add your Redirect Urls to URL Configuration in Authentication in Supabase.

Localhost would be http://localhost:3000/**

Cloud

Create a new Supabase project and copy these values from your project dashboard. They can also be obtained by going to “Project settings” -> “API”.

You probably want to set your own SMTP server and set up your credentials in Supabase to avoid rate limiting. You can do this by going to “Project settings” -> “Authentication” -> “SMTP Settings”. In this case, make sure you set spf and dkim in your DNS records. Otherwise, your emails will not be delivered to some providers like gmail.

Don’t forget to save your database password in a secure location. Otherwise, you have to reset it.

Selfhosted

For local development, go to supabase/config.toml and set your project name. Start your database by running

cd supabase
supabase start

You will then get your keys displayed in the terminal. Copy them to your .env file. Of course, you can also use your self-hosted Supabase instance.

Migration

Before you can start using Supabase, you need to run the migrations.

For local development, you can use the following commands (should be run automatically when starting the project):

cd supabase
npx supabase migration up

When using a hosted Supabase instance, link your project or paste the migrations manually.

For production, you should use a CI. See Deployment - Supabase for more information.