mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Problem Since CLI 3.4.0 (released 2026-11-24), `supabase init` creates `supabase/config.jsonc` for new projects instead of `supabase/config.toml`. The file starts with a `$schema` key, so editors get validation and autocomplete straight away. Projects that already have a `config.toml` aren't touched, and the CLI keeps reading it the same way. A handful of guides still say `init` creates `config.toml`. ## Solution - `cli/config-formats.mdx`: the file table marks `config.jsonc` as the one `init` creates in CLI 3.4.0 and later, and the "Minimum CLI version" section says earlier versions create `config.toml`. Under the table there's a short line saying a `config.toml` project keeps working, and pointing at `supabase config convert --to toml` for anyone who wants TOML. The schema section says `init` writes the `$schema` key into `config.jsonc`, rather than the TOML `#:schema` line. - `cli/getting-started.mdx`: the setup admonition and the `supabase init` step name `config.jsonc`, and the step mentions `config convert --to toml` with a link to Config file formats. - `managing-config.mdx`, `cli-workflows.mdx` (step 1 and the key commands table) and `running-multiple-local-projects.mdx` (the `SUPABASE_EXPERIMENTAL_STACK=1 supabase init` bit) had the same "init creates `config.toml`" statement, so I've updated those too. I've left the many "edit `supabase/config.toml`" references across the other guides alone - they're about where a setting lives rather than what `init` creates, and the per-format config examples cover them. ## Review instructions 1. Open Config file formats, CLI getting started, Managing config and Local development workflow on the preview. 2. Check they say `supabase init` creates `config.jsonc` (CLI 3.4.0 and later), and that `config.toml` projects are described as still working. 3. Check the `--to toml` links land on the "Convert back to TOML" section. ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [x] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
69 lines
3.0 KiB
Plaintext
69 lines
3.0 KiB
Plaintext
---
|
|
id: 'managing-config'
|
|
title: 'Managing config and secrets'
|
|
description: 'Managing local configuration using your config file.'
|
|
---
|
|
|
|
The [Supabase CLI](/docs/guides/local-development/cli/getting-started) uses a config file to manage local configuration. The file is `supabase/config.toml` or `supabase/config.jsonc`.
|
|
|
|
Since CLI 3.4.0, `supabase init` creates `config.jsonc`. A project with a `config.toml` keeps working without changes. To switch formats, see [Config file formats](/docs/guides/local-development/cli/config-formats).
|
|
|
|
## Config reference
|
|
|
|
There are a wide variety of options available, which can be found in the [CLI Config Reference](/docs/guides/local-development/cli/config).
|
|
|
|
For example, to enable the "Apple" OAuth provider for local development, add the following to your config file. Merge its keys into the entries your file already has instead of adding a second copy. Fill in your client ID and set `SUPABASE_AUTH_EXTERNAL_APPLE_SECRET` in your `.env` file, as described in [Using secrets inside your config file](#using-secrets-inside-configtoml):
|
|
|
|
```toml supabase/config.toml
|
|
[auth.external.apple]
|
|
enabled = true
|
|
client_id = ""
|
|
secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"
|
|
redirect_uri = "" # Overrides the default auth redirectUrl.
|
|
```
|
|
|
|
## Using secrets inside your config file [#using-secrets-inside-configtoml]
|
|
|
|
You can reference environment variables within your config file using the `env()` function. The CLI reads any values stored in an `.env` file at the root of your project directory. This is particularly useful for storing sensitive information like API keys, and any other values that you don't want to check into version control.
|
|
|
|
```
|
|
.
|
|
├── .env
|
|
├── .env.example
|
|
└── supabase
|
|
└── config.toml
|
|
```
|
|
|
|
<Admonition type="danger">
|
|
|
|
Do NOT commit your `.env` into git. Be sure to configure your `.gitignore` to exclude this file.
|
|
|
|
</Admonition>
|
|
|
|
For example, if your `.env` contained the following values:
|
|
|
|
```bash
|
|
GITHUB_CLIENT_ID=""
|
|
GITHUB_SECRET=""
|
|
```
|
|
|
|
Then you would reference them in your config file like this:
|
|
|
|
```toml supabase/config.toml
|
|
[auth.external.github]
|
|
enabled = true
|
|
client_id = "env(GITHUB_CLIENT_ID)"
|
|
secret = "env(GITHUB_SECRET)"
|
|
redirect_uri = "" # Overrides the default auth redirectUrl.
|
|
```
|
|
|
|
### Going further
|
|
|
|
For more advanced secrets management workflows, including:
|
|
|
|
- **Using dotenvx for encrypted secrets**: Learn how to securely manage environment variables across different branches and environments
|
|
- **Branch-specific secrets**: Understand how to manage secrets for different deployment environments
|
|
- **Encrypted configuration values**: Use encrypted values directly in your config file
|
|
|
|
See the [Managing secrets for branches](/docs/guides/deployment/branching/configuration#managing-secrets-for-branches) section in our branching documentation, or check out the [dotenvx example repository](https://github.com/supabase/supabase/blob/master/examples/slack-clone/nextjs-slack-clone-dotenvx/README.md) for a complete implementation.
|