Home

Using environment variables in config.toml

The Supabase CLI is capable of utilizing environment variables stored in our project's root directory's .env file within the config.toml file.

We can reference the environment variable by using the env() function.

Inside of our .env file we add the environment variable as we normally would

GITHUB_CLIENT_ID=""
GITHUB_SECRET=""

And then reference them inside of our config.toml

[auth.external.github]
enabled = true
client_id = "env(GITHUB_CLIENT_ID)"
secret = "env(GITHUB_SECRET)"
# Overrides the default auth redirectUrl.
redirect_uri = ""

These same environment variables will be referenced by the supabase start command from the Supabase CLI.