Feature flags in Capacitor apps with OTA updates
Combine feature flags with over-the-air updates to ship dark, flip features on remotely, and run controlled rollouts — without a store release. Patterns for Capacitor apps using OtaKit channels.
Feature flags and over-the-air updates are a natural pair. OTA lets you ship code without a store release; feature flags let you decide when that code turns on — and for whom. Together they give a Capacitor app the release flexibility of a modern web app: ship dark, flip features remotely, run controlled rollouts, and kill a broken feature without a redeploy. This guide covers the patterns, using OtaKit.
Mental model: OTA moves the code onto the device; a feature flag decides whether that code is active. Decoupling “shipped” from “on” is what makes releases calm.
Two ways to drive flags in a Capacitor app
- Remote config from your API. The app fetches a flag payload on launch and gates features on it. Flags change instantly, independent of any code release.
- Channel-based flags via OTA. Use OtaKit channels to serve different bundles — or bundles with different baked-in defaults — to different audiences. Great for beta cohorts and staged feature exposure.
Most teams combine both: OTA ships the feature; a runtime flag controls exposure.
Ship dark, then flip
Deploy the feature behind a flag that's off. The code is on every device via OTA, but invisible. When you're ready, flip the flag — no new release, no store wait:
// simplest possible flag gate
const flags = await fetchFlags(); // your API or remote config
if (flags.newCheckout) {
renderNewCheckout();
} else {
renderLegacyCheckout();
}Controlled rollouts with channels
For a feature you want to expose gradually, combine flags with staged rollouts. Serve the feature-on bundle to a beta channel, watch the metrics, then widen:
import { OtaKit } from "@otakit/capacitor-updater";
// opt a device into the beta cohort
await OtaKit.setChannel({ channel: "beta" });The kill switch
The most underrated benefit: turning a feature off instantly. If a newly enabled feature misbehaves, flip its flag back rather than scrambling to ship a fix. Paired with OTA's rollback strategies, you have two independent safety levers — disable the feature, or roll back the bundle.
Keep flags tidy
- Give every flag an owner and a removal date — dead flags become tech debt.
- Default new flags to off; make turning something on a deliberate act.
- Don't gate native capabilities on a flag — those still require a store release regardless of the flag. See what OTA can and can't change.
Ship dark, roll out gradually, and keep a kill switch. That's the whole discipline — and OTA is what makes it possible on mobile without waiting on review.
Where to go next
See channels & runtime version and staged rollouts for the rollout mechanics.