All docs

Deployment

Environment variables

Managing secrets and configuration across environments.

Setting environment variables

Environment variables can be set in three places: 1. **Dashboard**: Navigate to Settings then Environment Variables 2. **CLI**: `compos env set KEY=value` 3. **Config file**: In `compos.config.ts`

Environment scopes

Variables can be scoped by environment:

  • **Production**: Available in production deployments
  • **Preview**: Available in preview deployments
  • **Development**: Available in local development

Encrypted variables

Values marked as encrypted are stored so they never appear in dashboards or logs and are only handled at runtime where the workload needs them.

Built-in variables

compos provides these variables automatically:

  • `COMPOS_ENV`: Current environment (production, preview, development)
  • `COMPOS_URL`: The deployment URL
  • `COMPOS_REGION`: The deployment region
  • `COMPOS_COMMIT_SHA`: The git commit that triggered the deployment