Environments

An environment scopes flag state and API keys within a project. Each project can have multiple environments. Environments are completely isolated — enabling a flag in Staging does not affect Production.

What an environment contains

  • Flag state — whether each flag is enabled or disabled in that environment, managed via FlagEnvironment
  • Rules — each flag's rules are configured independently per environment
  • API keys — keys are scoped to a single environment; the key your server uses determines which environment's values are returned

Default environments

New projects start with two environments:

  • Production — for real users
  • Staging — for pre-release testing

You can add more (e.g. Development, QA, Canary) depending on your plan limits.

Environment isolation

When you enable a flag in Staging, it has zero effect on Production. You can safely test a configuration change in Staging before applying it to Production.

# Production server uses the Production key
RELEASE_ANCHOR_KEY=<YOUR_PRODUCTION_API_KEY>

# Staging server uses the Staging key
RELEASE_ANCHOR_KEY=<YOUR_STAGING_API_KEY>

The API key your code passes in the Authorization header determines which environment is evaluated.

Creating an environment

  1. 1
    Open project settings

    In the sidebar, select your project. Go to SettingsEnvironments.

  2. 2
    Create the environment

    Click New Environment. Enter a name (e.g. QA or Development). Click Create.

    The new environment starts with all flags disabled and no API keys.

  3. 3
    Generate an API key

    Navigate to the new environment's API Keys section and generate a key. See API Keys → for details.

The number of environments per project depends on your plan: Free (2), Pro (5), Team (20), Enterprise (unlimited).

Deleting an environment

Go to SettingsEnvironments → select the environment → Delete.

Deleting an environment permanently removes all API keys and flag states associated with that environment. Any servers using those API keys will begin receiving 401 Unauthorized responses immediately.

Was this helpful?