# Vercel Integration: Environment variables explained

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.
