Reference

System environment variables

Vercel environment variables that are automatically populated by the system, such as the URL of the deployment or the name of the Git branch deployed.
Table of Contents

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 them to your deployments:

  1. Navigate to your project on your dashboard.
  2. Go to the Settings tab and click on the Environment Variables section.
  3. 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.

.env
VERCEL=1

Available at:build time

An indicator that the code is running in a Continuous Integration environment.

.env
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.

.env
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://.

.env
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://.

.env
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://.

.env
VERCEL_PROJECT_PRODUCTION_URL=my-site.com

Available at:Runtime

The ID of the Region where the app is running.

.env
VERCEL_REGION=cdg1

Available at:Both build and runtime

The unique identifier for the deployment, which can be used to implement Skew Protection.

.env
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.

.env
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.

.env
VERCEL_AUTOMATION_BYPASS_SECRET=secret

Available at:Both build and runtime

The Git Provider the deployment is triggered from.

.env
VERCEL_GIT_PROVIDER=github

Available at:Both build and runtime

The origin repository the deployment is triggered from.

.env
VERCEL_GIT_REPO_SLUG=my-site

Available at:Both build and runtime

The account that owns the repository the deployment is triggered from.

.env
VERCEL_GIT_REPO_OWNER=acme

Available at:Both build and runtime

The ID of the repository the deployment is triggered from.

.env
VERCEL_GIT_REPO_ID=117716146

Available at:Both build and runtime

The git branch of the commit the deployment was triggered by.

.env
VERCEL_GIT_COMMIT_REF=improve-about-page

Available at:Both build and runtime

The git SHA of the commit the deployment was triggered by.

.env
VERCEL_GIT_COMMIT_SHA=fa1eade47b73733d6312d5abfad33ce9e4068081

Available at:Both build and runtime

The message attached to the commit the deployment was triggered by.

.env
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.

.env
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.

.env
VERCEL_GIT_COMMIT_AUTHOR_NAME=John Doe

Available at:build time

The git SHA of the last successful deployment for the project and branch.

.env
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.

.env
VERCEL_GIT_PULL_REQUEST_ID=23
Last updated on September 18, 2024