Preview Deployments Features

Preview Deployments allow you to preview changes to your app in a live deployment without merging those changes to your Git project's production branch.
Table of Contents

Preview Deployments allow you to preview changes to your app in a live deployment without merging those changes to your Git project's production branch. Members of your team and people you share your previews with can give feedback on these changes with Comments, if enabled.

If you do not want to generate Preview Deployments, you can turn them off.

You need Vercel CLI version 22.0.0 or higher to use the features described in this section.

Preview environment variables are applied to deployments from any Git branch that does not match the Production Branch. When you add a preview environment variable, you can choose to apply to all non-production branches or you can select a specific branch.

Adding an Environment Variable
Adding an Environment Variable

Any branch-specific variables will override other preview environment variables with the same name. This means you don't need to replicate all your existing preview environment variables for each branch – you only need to add the values you wish to override.

If you have created a pull or merge request when using Git, the generated preview URL will be available as a comment from the Vercel bot in the body of the PR. This URL will always reflect the latest deployment changes.

Alternatively, you can view the preview URL in your dashboard:

  1. Select your project and select the Deployments tab
  2. Filter by Preview deployments to show all commits to any non-production branches
  3. Find your commit and select the URL under Domains. This URL will display only the changes relating to that deployment

All your Preview Deployments will have a Share button in the Vercel Toolbar, which can be used to share access for private preview URLs with all team members. To learn more, see Sharing Deployments.

If you're on an Enterprise team, you will be able to see who shared deployment URLs in your audit logs.

You can turn off Preview Deployments by using the "Ignore Build Step" option. For example, using this command, you can tell Vercel to only build your main branch and ignore all other branches. If the command returns "0", the build is skipped. If, however, a code "1" or greater is returned, a new deployment is built. For more information on ignoring the build step, see How do I use the "Ignored Build Step" field on Vercel?.

The Vercel Toolbar is available by default in all Preview Deployments, which enables your team to:

See the Vercel Toolbar docs to learn more.

You can receive feedback on your Preview Deployments from your team members and people you share the Preview URL with through the Comments feature.

Comments allow teams and participants outside the team to give direct feedback on Preview Deployments. Comments can be added directly over the areas of your site that are relevant to the feedback, and discussion threads can continue within the Preview Deployment itself or in an integrated Slack channel.

Learn more in the Comments docs.

Since a Preview Deployment creates a new version of your site under a different domain, a search engine would consider it as a new website when crawling it.

This can have a negative impact on the ranking of your main site since crawlers are able to detect when content is duplicated across multiple domains and lower the ranking of your site when measuring the content quality.

To prevent that, the X-Robots-Tag HTTP header is automatically set to noindex for all Preview Deployments so that search engines do not accidentally index the Preview URLs.

When a custom domain is assigned to a Git branch, this behavior is prevented. In that case, the X-Robots-Tag header is not set.

To learn more about the X-Robots-Tag, review this Google Search Reference.

Last updated on September 11, 2024