Guides
Kill switches and feature toggles
A worked example of feature flags as plain JSON, with a schema that keeps them safe.
In hotcfg, feature flags are one JSON document your app reads. (Overrides by platform, build number or rollout percentage work with a jq filter: see version targeting.) That covers most of what teams use flags for: turning a feature on, turning a broken one off, and changing a limit or a price.
The config
{
"features": { "checkout_v2": false, "new_onboarding": true },
"kill": { "image_uploads": false },
"limits": { "max_upload_mb": 25 },
"min_supported_version": "4.2.0"
}A schema that keeps it safe
Require every key the app reads, and give each a type. A flag can then never be missing or the wrong type in production.
{
"type": "object",
"required": ["features", "kill", "limits", "min_supported_version"],
"properties": {
"features": { "type": "object", "additionalProperties": { "type": "boolean" } },
"kill": { "type": "object", "additionalProperties": { "type": "boolean" } },
"limits": {
"type": "object",
"required": ["max_upload_mb"],
"properties": { "max_upload_mb": { "type": "integer", "minimum": 1, "maximum": 500 } }
},
"min_supported_version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }
}
}In the app
Load the config with the fetch code, then read flags with a default for anything missing:
let config = (try? JSONSerialization.jsonObject(with: await HotcfgConfig.load())) as? [String: Any] ?? [:]
let kill = config["kill"] as? [String: Bool] ?? [:]
if kill["image_uploads"] == true { hideUploadButton() }Flipping a kill switch
Change the value and publish to production, from the dashboard or the CLI. For complete apps, see the iOS kill switch, React Native maintenance mode and Godot recipes. Every app sees it on its next fetch. When the fix ships, flip it back, or roll back to the version before.
Last updated 10 November 2026