> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sweetr.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Organize deployments by environment to track metrics across your deployment targets.

export const CtaGetStarted = ({label = "Ready to make delivery flow again?"}) => <div style={{
  display: "flex",
  justifyContent: "space-between",
  alignItems: "center",
  marginTop: 80,
  background: "#1a1b1e",
  color: "#fff",
  borderRadius: 8,
  border: "1px solid #69db7c",
  padding: "10px"
}}>
    <div style={{
  display: "flex",
  justifyContent: "space-between",
  alignItems: "center",
  gap: 12,
  fontWeight: 500
}}>
      <img src="https://mintlify.s3-us-west-1.amazonaws.com/sweetrdev/logo.svg" height={24} width={24} style={{
  margin: 0
}} />
      <div>{label}</div>
    </div>
    <a href="https://github.com/apps/sweetr-dev/installations/new" rel="nofollow" className="not-prose" style={{
  padding: "8px 16px",
  background: "#69db7c",
  color: "#000",
  borderRadius: 4,
  fontSize: 14
}}>
      Try now
    </a>
  </div>;

## Demo

<Frame>
  <img src="https://mintcdn.com/sweetrdev/pcmOxpRgFjEN2lK0/images/environments.png?fit=max&auto=format&n=pcmOxpRgFjEN2lK0&q=85&s=30cb4957c9b9f5a545e79c8d20378648" width="2560" height="1280" data-path="images/environments.png" />
</Frame>

## How it works

Environments represent deployment targets like `production`, `staging`, or `qa`. Deployments are always associated with an environment, and metrics can be filtered by environment.

A default **production** environment is created for every workspace. Additional environments are created automatically when a deployment is sent via the [API](/api-reference/deployments/create-deployment) with an environment name that doesn't exist yet.

<Note>
  Environments named `production` or `prod` (case-insensitive) are automatically
  marked as production environments.
</Note>

## Production flag

Each environment has an `isProduction` flag. This matters because DORA metrics default to production environments only. Non-production deployments are excluded unless you explicitly filter for them.

## When to use multiple environments

For most teams, the default `production` environment is all you need. Multiple environments are useful when:

* **You want to measure metrics for non-production environments**, for example, tracking deployment frequency to staging.
* **You have multiple production environments**, for example, regional deployments (`production-us`, `production-eu`). Since only exact names `production` or `prod` are auto-detected, you must explicitly set the production flag for regional environment names.

## Archiving

Environments that are no longer in use can be archived. Archived environments are hidden from filters and excluded from metrics. You can unarchive them at any time.

## Related

<CardGroup cols={2}>
  <Card title="Deployments" icon="rocket" href="/platform/deployments" />

  <Card title="Applications" icon="cube" href="/platform/applications" />

  <Card title="DORA Metrics" icon="chart-line" href="/metrics-and-insights/dora" />
</CardGroup>

<CtaGetStarted />
