mirror of
https://github.com/supabase/supabase.git
synced 2026-06-01 18:34:37 +08:00
This PR syncs the latest troubleshooting guides from the supabase/troubleshooting repository. --------- Co-authored-by: github-docs-bot <github-docs-bot@supabase.com> Co-authored-by: Chris Chinchilla <chris.ward@supabase.io> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
26 lines
1.4 KiB
Plaintext
26 lines
1.4 KiB
Plaintext
---
|
|
title = "Vercel Integration: Environment variables explained"
|
|
topics = [ "platform" ]
|
|
keywords = []
|
|
---
|
|
|
|
Vercel has three environments, which map to different stages of the deployment lifecycle:
|
|
|
|
- **Production** is used for the branch configured as the production branch (usually main). Deployments from that branch go to the live site.
|
|
- **Preview** is used for all other Git branches, including pull requests, feature branches, and persistent branches like staging. If you deploy a staging branch, it still runs under the Preview environment unless you explicitly create a separate environment in Vercel and map that branch to it.
|
|
- **Development** is only used for local development via the Vercel CLI (`vercel dev`). It allows your local environment to pull env vars from Vercel, but it does not apply to Git branches or deployments on the platform.
|
|
|
|
### Creating a staging environment
|
|
|
|
On the Hobby plan, staging is implemented by scoping Preview environment variables to a branch. On the Pro plan, staging can be configured as a dedicated environment with its own settings.
|
|
|
|
You can create a dedicated environment (Vercel Pro):
|
|
|
|
1. Go to `Project` → `Settings` → `Environments`
|
|
2. Click `Create Environment`
|
|
3. Name it `staging`
|
|
4. Enable `Branch Tracking` and select the `staging` branch
|
|
5. Add environment variables scoped to this environment
|
|
|
|
With this setup, the staging branch deploys to its own environment and is fully separate from Preview and Production.
|