Skip to main content
A stage is an environment inside a project, such as:
  • development
  • staging
  • production
Variables are isolated per stage. The same key name can exist in multiple stages with different values.

Why stages matter

If you store:
  • DATABASE_URL in development
  • DATABASE_URL in production
those are two separate variables with separate values. Changing one does not affect the other.

How the CLI targets a stage

The CLI resolves the stage from:
  1. --stage
  2. barekey.json
Example:

How the SDK targets a stage

With explicit configuration:
Or through barekey.json:

Good stage habits

  • keep development, staging, and production values separate
  • commit barekey.json so teammates target the same default stage
  • use --stage explicitly in scripts when the target matters
  • use production tokens and production stages carefully