> ## 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.

# Environments

> Adding, configuring, and deleting environments. Default Preview / Production setup, plus custom environments for staging and per-team.

Every project starts with two environments: **Preview** (auto-deploys every change) and **Production** (manually promoted). You can add more — staging, QA, per-team — as needed.

## Default environments

| Environment | Triggered by | Visible at |
| - | - | - |
| Preview | Every prompt or hand-edit | `*.vly.app` |
| Production | Manual promotion | Custom domain (or `*.vly.app` if not configured) |

## Adding a custom environment

<Steps>
  <Step title="Settings → Environments → Add environment">
    Pick a name (`staging`, `qa`, `demo-acme`).
  </Step>

  <Step title="Configure secrets per environment">
    Each environment has its own secrets store. Stripe test keys in staging; live in production.
  </Step>

  <Step title="Promote into the environment">
    From any preview, click "Promote to \[env name]".
  </Step>

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

## Per-environment differences

What can vary between environments:

| | Yes |
| - | - |
| Secrets | ✓ |
| Custom domain | ✓ |
| Indexing (`X-Robots-Tag: noindex` for non-prod) | ✓ |
| Analytics destination (`GA4` test vs prod property) | ✓ |
| Feature flags | ✓ (via env-aware code) |

What can't:

| | No |
| - | - |
| Schema | All environments share the same schema |
| Codebase | Same code; differences are env-driven |

For schema differences across environments, use [branching](/building/branching) instead of environments.

## Deleting an environment

Settings → Environments → \[env] → Delete. Removes the environment, its secrets, and (if attached) the custom domain. Other environments are unaffected.

## Related

<CardGroup cols={3}>
  <Card title="Environment variables" icon="key-round" href="/deployment/environment-variables">
    Setting per-environment env vars.
  </Card>

  <Card title="Secrets" icon="lock" href="/deployment/secrets">
    Secret-store mechanics.
  </Card>

  <Card title="Staging vs production" icon="git-branch" href="/deployment/staging-vs-production">
    Promotion patterns.
  </Card>
</CardGroup>


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