> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Staging vs production

> Patterns for safe promotion. When to add a staging environment, and how to gate it.

vly's default flow is **Preview → Production**. For teams that want a "shared QA" gate between, add a Staging environment.

## When you need staging

<CardGroup cols={2}>
  <Card title="Multiple developers" icon="users">
    Each PR has its own preview, but a shared staging is where they integrate before production.
  </Card>

  <Card title="QA team" icon="bug">
    QA tests against a known stable environment, separate from individual PR previews.
  </Card>

  <Card title="Customer demos" icon="presentation">
    Sales team demos against staging — predictable URL, controlled state.
  </Card>

  <Card title="Regulatory review" icon="award">
    Compliance reviews of new features before they hit production.
  </Card>
</CardGroup>

## Standard 3-stage flow

```
Preview (per-change) → Staging (shared) → Production
```

Promotion:

* Preview → Staging: open a PR, merge to a `staging` branch (or click "Promote to staging" in vly's UI).
* Staging → Production: manual promotion after sign-off.

## Setting up

<Steps>
  <Step title="Add the staging environment">
    Settings → Environments → Add. Name: `staging`.
  </Step>

  <Step title="Configure secrets">
    Production keys (so it behaves like production) OR test keys (so payments / emails are sandboxed).
  </Step>

  <Step title="Add a staging domain">
    `staging.yourapp.com` → CNAME to the staging environment.
  </Step>

  <Step title="Document the promotion process">
    Who can promote, when, what gates apply. Add to your team's playbook.
  </Step>
</Steps>

## Promotion gates

For higher-trust environments:

* **PR review required** (via [GitHub integration](/integrations/github)).
* **Test suite passing** (GitHub Actions).
* **Automated smoke tests against staging** before promoting to production.
* **Manual sign-off** by a release manager.

## Tips

<Tip>
  **For most apps, two environments is enough.** Don't add staging until the team's coordination cost outweighs preview's parallelism.
</Tip>

<Tip>
  **Keep staging fresh.** A long-lived staging that drifts from production becomes useless. Promote at least weekly.
</Tip>

## Related

<CardGroup cols={3}>
  <Card title="Environments" icon="layers" href="/deployment/environments">
    Adding and configuring.
  </Card>

  <Card title="Rollback" icon="undo" href="/deployment/rollback">
    The escape hatch.
  </Card>

  <Card title="Preview deployments" icon="eye" href="/deployment/preview-deployments">
    Per-change previews.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.