Skip to content

Feature Flags

Manage feature flags and service configurations across dev/staging/prod environments with conditional logic.

Managing configs across environments means:

  • Separate files — One config file per environment
  • Duplication — Same structure repeated 3+ times
  • Sync issues — Easy to miss updates in some environments
featureFlags [
template { feature, env, enabled }
map (flag) = {
name = flag.feature
environment = flag.env
enabled = flag.enabled
key = flag.feature + "_" + flag.env
rolloutPercentage = flag.enabled == true ? 100 : 0
rolloutStrategy = "gradual"
}
// New features - off in prod
"new-dashboard", "prod", false
"new-dashboard", "staging", true
"new-dashboard", "dev", true
// Stable features - on everywhere
"dark-mode", "prod", true
"dark-mode", "staging", true
"dark-mode", "dev", true
]
serviceConfig [
template { service, env }
map (cfg) = {
serviceName = cfg.service
environment = cfg.env
// Database
databaseHost = "db-" + cfg.env + ".internal"
maxConnections = cfg.env == "prod" ? 100 : 20
sslEnabled = cfg.env == "prod" ? true : false
// Cache
cacheHost = "redis-" + cfg.env + ".internal"
cacheTTL = cfg.env == "prod" ? 3600 : 300
// Logging
logLevel = cfg.env == "prod" ? "error" : "debug"
}
"api", "prod"
"api", "staging"
"api", "dev"
]

Single source — One file for all environments
Conditional logic — Different values per environment
Easy toggles — Change true to false
Consistency — Same structure everywhere

Perfect for:

  • Feature flag management
  • Environment-specific configs
  • A/B testing setups
  • Rollout strategies
  1. Save to feature-flags.jsson
  2. Run: jsson -i feature-flags.jsson
  3. Manage your features!

Toggle features with confidence! 🚀