Switchflag
Platform

Environments

Each project has independent environments with separate flag configurations and API keys.

Overview

Environments let you manage flag configurations independently across development, staging, and production (or any custom environments). Each environment has:

  • Its own API key
  • Independent flag enabled/disabled state
  • Independent targeting rules

Default environments

Every new project comes with three environments:

EnvironmentAPI Key PrefixTypical Use
Developmentsf_dev_Local development and testing
Stagingsf_stg_Pre-production validation
Productionsf_prod_Live user traffic

Independent configuration

Flag configuration is fully independent per environment. This means:

  • A flag can be enabled in development but disabled in production
  • Targeting rules can differ — you might have a 100% rollout in staging but 10% in production
  • The default value is shared (it's on the flag itself), but the environment controls whether the flag is active

API key scope

Each environment's API key only returns flag data for that environment. A sf_dev_ key cannot access production flag states. This prevents accidentally reading the wrong environment's configuration.

Workflow

A typical release workflow:

  1. Enable and test the flag in development
  2. Promote to staging — enable the flag and run integration tests
  3. Roll out to production — enable with a percentage rollout, then ramp up