strackt docs
Browse docs

How To

Preview environments

Get a live, isolated deployment for every GitHub pull request, cleaned up automatically when the PR closes.

Preview environments

A preview environment is a live, throwaway copy of your application spun up for a single pull request. Open a PR and strackt deploys that branch to its own URL, so you can click through the change before it merges. Close the PR and the preview is cleaned up.

Turn previews on

Previews are enabled per application, from the application's page. When you turn them on, strackt makes a template from your production environment — or staging, if production isn't ready — and every per-PR preview is cloned from that template.

The template carries your production settings, connected services, and environment variables, so a preview behaves like the real thing without you filling in a form each time. You can edit the template afterwards if a preview should differ from production — see the secrets note below before you share a preview URL publicly.

What happens when you open a pull request

Once previews are on and your repository is connected through GitHub:

  1. You open a PR → strackt clones the template, deploys the pull-request branch, and gives the preview its own URL.
  2. You get a notification with the preview link, and the environment's page shows a banner with the PR number, the branch, and the URL.
  3. You push more commits → the preview redeploys with the latest code.
  4. You close or merge the PR → strackt removes the preview (depending on your cleanup settings below).

Settings

| Setting | What it does | |---|---| | Maximum concurrent previews | Caps how many live previews one application can have at once. Past the cap, new PRs are held off and you're told the limit was reached. | | Idle timeout | Removes a preview that's had no activity for the number of days you set. Leave it empty to keep previews until the PR closes or you delete them. | | Allow previews from forks | Lets pull requests from forked repositories run on your infrastructure. Off by default, because a fork PR runs code from outside your team. | | Auto-delete | Chooses whether previews are removed when a PR is merged, closed without merging, or goes idle. Leave it empty to keep previews until you delete them by hand. |

A note on secrets

A preview starts as a copy of your production (or staging) environment, which means it inherits the same environment variables and connected services. That's what makes previews quick to set up — but it also means production-like secrets can end up on a preview URL until you edit the template. Before sharing a preview link, review the template's environment variables and remove anything that shouldn't be reachable from a public preview.

What previews don't do yet

  • GitHub only. Previews are driven by GitHub pull requests. GitLab and Bitbucket aren't supported yet.
  • No database copy. A preview connects to whatever the template points at; it doesn't clone or seed a fresh database for each PR.
  • Fork approval is per application, not per PR. The "allow previews from forks" switch is all-or-nothing — there's no approve-this-one-PR control yet.

If a preview doesn't appear after you open a PR, check that previews are enabled for the application and that your repository is connected through GitHub.

Was this helpful?

Related docs