System environment variables
Vercel provides a set of environment variables that are automatically populated by the system, such as the URL of the deployment or the name of the Git branch deployed.
To expose these environment variables to your deployments:
- Navigate to your project on your dashboard.
- Go to the Settings tab and click on the Environment Variables section.
- Select the Automatically expose System Environment Variables checkbox.
If you are using a framework for your project, Vercel provides the following prefixed environment variables:
When you choose to automatically expose system environment variables, some
React warnings, such as those in a create-react-app will display as build
errors. For more information on this error, see How do I resolve a
process.env.CI = true
error?
Available at:Both build and runtime
An indicator to show that system environment variables have been exposed to your project's Deployments.
VERCEL=1Available at:Build time
An indicator that the code is running in a Continuous Integration environment.
CI=1Available at:Both build and runtime
The environment that the app is deployed and running on. The value can be either production, preview, or development.
VERCEL_ENV=productionAvailable at:Both build and runtime
The system or custom environment that the app is deployed and running on. The value can be either production, preview, development, or the name of a custom environment.
VERCEL_TARGET_ENV=productionAvailable at:Both build and runtime
The domain name of the generated deployment URL. Example: *.vercel.app. The value does not include the protocol scheme https://.
VERCEL_URL=my-site.vercel.appAvailable at:Both build and runtime
The domain name of the generated Git branch URL. Example: *-git-*.vercel.app. The value does not include the protocol scheme https://.
VERCEL_BRANCH_URL=my-site-git-improve-about-page.vercel.appAvailable at:Both build and runtime
A production domain name of the project. We select the shortest production custom domain, or vercel.app domain if no custom domain is available. Note, that this is always set, even in preview deployments. This is useful to reliably generate links that point to production such as OG-image URLs. The value does not include the protocol scheme https://.
VERCEL_PROJECT_PRODUCTION_URL=my-site.comAvailable at:Both build and runtime
The unique identifier for the deployment, which can be used to implement Skew Protection.
VERCEL_DEPLOYMENT_ID=dpl_7Gw5ZMBpQA8h9GF832KGp7nwbuh3Available at:Both build and runtime
The unique identifier for the project.
VERCEL_PROJECT_ID=prj_Rej9WaMNRbffVm34MfDqa4daCEvZzzEAvailable at:Both build and runtime
When Skew Protection is enabled in Project Settings, this value is set to 1.
VERCEL_SKEW_PROTECTION_ENABLED=1Available at:Both build and runtime
The Protection Bypass for Automation value, if the secret has been generated in the project's Deployment Protection settings.
VERCEL_AUTOMATION_BYPASS_SECRET=secretAvailable at:Build time
When Secure Backend Access with OpenID Connect (OIDC) Federation is enabled in Project Settings, this value is set to a Vercel-issued OIDC token. At runtime, the token is set to thex-vercel-oidc-token header on your functions' Request object. In local development, you can download the token using the CLI commandvercel env pull.
VERCEL_OIDC_TOKEN=secretAvailable at:Both build and runtime
The Git Provider the deployment is triggered from.
VERCEL_GIT_PROVIDER=githubAvailable at:Both build and runtime
The origin repository the deployment is triggered from.
VERCEL_GIT_REPO_SLUG=my-siteAvailable at:Both build and runtime
The account that owns the repository the deployment is triggered from.
VERCEL_GIT_REPO_OWNER=acmeAvailable at:Both build and runtime
The ID of the repository the deployment is triggered from.
VERCEL_GIT_REPO_ID=117716146Available at:Both build and runtime
The git branch of the commit the deployment was triggered by.
VERCEL_GIT_COMMIT_REF=improve-about-pageAvailable at:Both build and runtime
The git SHA of the commit the deployment was triggered by.
VERCEL_GIT_COMMIT_SHA=fa1eade47b73733d6312d5abfad33ce9e4068081Available at:Both build and runtime
The message attached to the commit the deployment was triggered by.
VERCEL_GIT_COMMIT_MESSAGE=Update about pageAvailable at:Both build and runtime
The username attached to the author of the commit that the project was deployed by.
VERCEL_GIT_COMMIT_AUTHOR_LOGIN=johndoeAvailable at:Both build and runtime
The name attached to the author of the commit that the project was deployed by.
VERCEL_GIT_COMMIT_AUTHOR_NAME=John DoeAvailable at:Build time
The git SHA of the last successful deployment for the project and branch.
VERCEL_GIT_PREVIOUS_SHA=fa1eade47b73733d6312d5abfad33ce9e4068080Available at:Both build and runtime
The pull request id the deployment was triggered by. If a deployment is created on a branch before a pull request is made, this value will be an empty string.
VERCEL_GIT_PULL_REQUEST_ID=23Was this helpful?