Project Configuration
Deployment Environments
Map branches to named environments so each one gets its own configuration — its own environment variables, URL, and settings.
In the dashboardProject → Settings → Environments
By default every project has Production, Preview, and Development. You can define additional environments and target them by branch pattern.
Branch targeting
Each environment matches branches by a pattern. The first environment whose pattern matches the pushed branch is used for that deployment.
| Environment | Branch pattern | Result |
|---|---|---|
| Production | main | Deploys to the production URL |
| Staging | staging | Deploys with staging config |
| Preview | * | Any other branch gets a preview deployment |
Per-environment configuration
Environment variables can be scoped to specific environments, so a value can differ between Production and Preview without code changes. See environment targets in the Environment Variables guide.
Use distinct API keys and database URLs per environment so a preview deployment can never touch production data.

