Pre-production environments

Use pre-production environments to preview and test your changes.
Table of Contents

Pre-production environments are designed for testing changes in a live setting that mimics the production site, but is not public-facing. Each pull request or branch or commit can have its own preview deployment.

Vercel creates a new preview deployment by default when:

  • You commit changes to a connected Git branch that is not the production branch (e.g. main)
  • You create a deployment using our CLI's vercel command
  • When you push to a branch or open a PR, Vercel automatically creates a preview deployment for every commit.

These deployments are accessible through an automatically-generated URL, which is available either as a comment in your PR or in the Vercel dashboard.

  • Branch-specific URLs will always have the latest changes on that branch.
  • Commit-specific URLs will always have the changes from that specific commit.
  • You can configure preview environments using the vercel.json file.
  • Environment variables specific to preview environments can be managed in the Vercel dashboard.

If you do not want to generate preview deployments automatically, you can turn them off.

To create an environment variables for your pre-production environment, follow the steps to declare an environment variable and ensure you select the environment(s) you require.

Last updated on October 31, 2024