Skip to main content
One model for per-deploy config A deploy context is the kind of deploy an app is running: production, deploy-preview (a pull request preview) or branch-deploy (a branch deploy). You can override env vars and static build settings for each, and for a named branch or branch pattern, without touching the app’s own defaults.

What you can set

Context names: deploy-preview, branch-deploy, and branch:<pattern> where the pattern is an exact branch name or a glob such as release/*. production is the app’s own settings, so it takes no overrides.

Resolution order

For every value, the first match wins, highest first:
  1. Branch env override (apps branch-env), exact pattern before glob.
  2. Branch context (branch:<pattern>), exact pattern before glob.
  3. The deploy’s context (deploy-preview or branch-deploy).
  4. The older app-wide preview env override (apps preview-env), previews only.
  5. The app default.
A per-pull-request override (apps pr-env) still wins over all of these for that pull request. Existing branch env overrides and preview env overrides keep working unchanged.

Set contexts

Open the app, then Previews, and use Deploy contexts. Pick a context, fill in env vars (one KEY=VALUE per line) and any build settings, then save. Settings you leave empty inherit.

See the effective config

The Effective config for this deploy view shows, for a chosen context and branch, every env var and build setting with where its value came from. Secrets, and values whose names look sensitive, stay masked. It appears under Previews and on each deploy’s build tab.

What this does not do

  • Production deploys use the app’s own settings only.
  • Context env vars are stored as plain values, so keep secrets in branch env overrides or app secrets.
  • Build overrides only change what a preview or branch deploy builds. They never touch the production build.
Last modified on October 21, 2026