Back to blog
Product

Preview environments that match production

How Relay spins up isolated deploy previews per pull request with production parity and automatic teardown.

Priya Nair

Priya Nair

Relay Team

Preview environments that match production

Every pull request on Relay can ship a live preview URL in minutes. The preview runs the same build artifacts, environment variables, and deploy gates as production — minus the production database.

What ships in a preview

When a PR opens, Relay builds your app, runs tests, and deploys to a unique subdomain like pr-482.preview.relay.dev. Reviewers get a shareable link without asking an engineer to deploy manually.

Previews inherit secrets scoped to the preview environment, so staging API keys and feature flags behave the way you expect in QA.

Automatic cleanup

Merged, closed, or stale PRs trigger teardown automatically. TTL controls let platform teams cap how long idle previews stay online, which keeps cloud spend predictable on busy monorepos.

Getting started

Add a preview: block to relay.yaml or enable previews under Settings → Environments. Most Next.js and static sites work out of the box with the default buildpack.

See the Preview environments guide for custom domains, auth walls, and monorepo path filters.