Skip to content

Environments

Environments scope your flag and segment configuration, so the same flag can behave differently depending on which environment evaluates it. Every project starts with a production environment.

Each feature flag holds per-environment configuration: whether it’s enabled or off, its fallthrough value, and its targeting rules. That config lives independently in each environment.

Each environment compiles to its own payload, so evaluating a flag in production reads the production config and evaluating it in another environment reads that environment’s config. Changing a flag in one environment doesn’t touch the others.

Create environments with the REST API:

Terminal window
curl -X POST https://statskit.ai/api/v1/environments \
-H "Authorization: Bearer vsk_live_…" \
-H "Content-Type: application/json" \
-d '{"key": "staging", "name": "Staging"}'

See Segments for the related targeting API.

Add a staging environment when you want to configure and test flag behavior without affecting live traffic:

  • Test targeting rules against a staging build before turning them on in production.
  • Enable a flag early for your team in staging while it stays off in production.
  • Keep experiments contained so a change to staging config never rolls out to real users.