System environment variables
System environment variables are automatically populated by Vercel, such as the URL of the deployment or the name of the Git branch deployed.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=1
Available at:build time
An indicator that the code is running in a Continuous Integration environment.
CI=1
Available 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=production
Available at:Both build and runtime
The domain name of the generated deployment URL. Example: *.vercel.app
. The value does not include the protocol schemehttps://
.
VERCEL_URL=my-site.vercel.app
Available 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.app
Available 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.com
Available at:Both build and runtime
The unique identifier for the deployment, which can be used to implement Skew Protection.
VERCEL_DEPLOYMENT_ID=dpl_7Gw5ZMBpQA8h9GF832KGp7nwbuh3
Available at:Both build and runtime
When Skew Protection is enabled in Project Settings, this value is set to 1
.
VERCEL_SKEW_PROTECTION_ENABLED=1
Available 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=secret
Available at:Both build and runtime
The Git Provider the deployment is triggered from.
VERCEL_GIT_PROVIDER=github
Available at:Both build and runtime
The origin repository the deployment is triggered from.
VERCEL_GIT_REPO_SLUG=my-site
Available at:Both build and runtime
The account that owns the repository the deployment is triggered from.
VERCEL_GIT_REPO_OWNER=acme
Available at:Both build and runtime
The ID of the repository the deployment is triggered from.
VERCEL_GIT_REPO_ID=117716146
Available at:Both build and runtime
The git branch of the commit the deployment was triggered by.
VERCEL_GIT_COMMIT_REF=improve-about-page
Available at:Both build and runtime
The git SHA of the commit the deployment was triggered by.
VERCEL_GIT_COMMIT_SHA=fa1eade47b73733d6312d5abfad33ce9e4068081
Available at:Both build and runtime
The message attached to the commit the deployment was triggered by.
VERCEL_GIT_COMMIT_MESSAGE=Update about page
Available 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=johndoe
Available 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 Doe
Available at:build time
The git SHA of the last successful deployment for the project and branch.
VERCEL_GIT_PREVIOUS_SHA=fa1eade47b73733d6312d5abfad33ce9e4068080
Available 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=23
Was this helpful?