Mobile API Best Practices · Versioning, Upgrades & Remote Control
Feature Flags & Remote Config
Decouple release from deploy for binaries you can't roll back.
Since you can't roll back a binary, ship features dark and enable them remotely: feature flags (per user/segment/percentage), remote config (copy, limits, URLs) and kill switches. Evaluate flags server-side where possible (the API simply returns or omits features) or deliver a signed, cached flag snapshot to clients with sane offline defaults. OpenFeature provides a vendor-neutral SDK API.
Where to evaluate flags
| Criterion | Server-side evaluation | Client-side evaluation (SDK) |
|---|---|---|
| Works offline | Uses last response | Yes (cached rules) |
| Leaks unreleased features | No | Rules/flag names visible in app |
| Latency | None extra (part of API) | Local |
| Targeting data | Full server context | What the device knows |
| Consistency across platforms | High | Per-SDK behavior |
import { OpenFeature } from "@openfeature/server-sdk";
const flags = OpenFeature.getClient();
app.get("/v1/home", async (req, res) => {
const ctx = { targetingKey: req.user.id, appVersion: req.appVersion, platform: req.platform };
const showReorder = await flags.getBooleanValue("home-reorder-card", false, ctx);
res.json({ sections: buildHome(req.user, { showReorder }) });
});
// Always have a safe default if config can't be fetched.
val maxUploadMb = remoteConfig.getLong("max_upload_mb").takeIf { it > 0 } ?: 25L
if (remoteConfig.getBoolean("kill_new_checkout")) showLegacyCheckout() else showNewCheckout()
Common pitfalls
- Flags that are never removed (permanent complexity).
- No default when config fetch fails.
- Flag explosion with no owner or expiry.
Key points
- Ship dark, enable remotely
- Kill switches for risky features
- Owners and expiry dates for flags
Further reading: OpenFeature
Practice questions
Why are feature flags especially valuable for mobile apps?
Answer
Binaries can't be rolled back quickly, so flags let you enable, ramp or kill features server-side without a new release.
What is the risk of evaluating flags on the client?
Answer
Targeting rules and unreleased feature names ship in the app and can be inspected; offline/stale rules also behave differently from server decisions.
Open in the app to mark lessons complete, take notes and track your progress.