firebase-remote-config
Skill0 starsChanged 5 months agoMITView on GitHub
Configures Firebase Remote Config for runtime feature flags and dynamic parameters — declaring defaults, fetching and activating, targeting by platform / app version / audience, and running basic A/B tests. Use whenever the user needs to change app behavior without shipping a new build, or wants a kill-switch for a risky feature.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- evanca/flutter-ai-rulestheir own version, first seen Aug 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- evanca/flutter-ai-rules★ 669same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- firebase-ai-logicSkill
- firebase-analyticsSkill
- firebase-app-checkSkill
- firebase-architectureSkill
- firebase-authSkill
- firebase-cloud-functionsSkill
- firebase-cost-optimizationSkill
- firebase-crashlyticsSkill
- firebase-emulatorsSkill
- firebase-expoSkill
- firebase-firestoreSkill
- firebase-hostingSkill
- firebase-messagingSkill
- firebase-realtime-databaseSkill
- firebase-storageSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Use Remote Config for:
- Distinctive: line 39
Do not use it for:
- Very specific: line 51
No native config needed beyond the @react-native-firebase/app plugin.
- Distinctive: line 83
Always wrap in a hook so React re-renders when config changes:
- Very specific: line 104
Parameter key: must match the string used in code (e.g.
- Very specific: line 134
Add parameter feature_x_enabled, default false
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Firebase Remote Config
Minimum viable example
import remoteConfig from "@react-native-firebase/remote-config";
await remoteConfig().setDefaults({ feature_x_enabled: false });
await remoteConfig().setConfigSettings({
minimumFetchIntervalMillis: __DEV__ ? 0 : 3600 * 1000,
});
await remoteConfig().fetchAndActivate();
const enabled = remoteConfig().getValue("feature_x_enabled").asBoolean();Defaults guarantee the app works offline. Set minimumFetchIntervalMillis: 0 in dev or you'll think your console changes aren't taking effect.
When to use it (and when not)
Use Remote Config for:
- Feature flags / kill switches — turn off a buggy feature instantly without a redeploy
- Tuning UI text, prices, copy — A/B test wording, change without an App Store review
- Targeting — different default for free vs. paid users, country, app version
- Gradual rollouts — ship a feature to 10% of users, ramp up if metrics look good
Do not use it for:
- User-specific state (use Firestore — Remote Config has no per-user storage)
- Anything that needs to be instant on every read (Remote Config caches; default min fetch interval is 12h in production)
- Secrets — values are visible to clients
1. Install (Expo / RN)
npx expo install @react-native-firebase/remote-configNo native config needed beyond the @react-native-firebase/app plugin.
2. Declare defaults in code
Defaults are the values used before the first fetch completes, or if fetch fails. Always provide sensible ones — your app must work offline.
import remoteConfig from "@react-native-firebase/remote-config";
await remoteConfig().setDefaults({
feature_new_checkout: false,
promo_banner_text: "",
max_uploads_per_day: 50,
});
await remoteConfig().setConfigSettings({
minimumFetchIntervalMillis: __DEV__ ? 0 : 3600 * 1000, // 1h in prod, no cache in dev
});
await remoteConfig().fetchAndActivate();fetchAndActivate is the right call on app start — it fetches if cache is stale, then activates the new template atomically.
3. Read values
const enabled = remoteConfig().getValue("feature_new_checkout").asBoolean();
const text = remoteConfig().getValue("promo_banner_text").asString();
const cap = remoteConfig().getValue("max_uploads_per_day").asNumber();Always wrap in a hook so React re-renders when config changes:
function useRemoteFlag(key: string, fallback: boolean) {
const [value, setValue] = useState(() => remoteConfig().getValue(key).asBoolean());
useEffect(() => {
return remoteConfig().onConfigUpdated(async () => {
await remoteConfig().activate();
setValue(remoteConfig().getValue(key).asBoolean());
});
}, [key]);
return value;
}onConfigUpdated is real-time — values update without a full app restart.
4. Define parameters in the console
Firebase Console → Remote Config → Add parameter:
- Parameter key: must match the string used in code (e.g.
feature_new_checkout) - Default value: used when no condition matches
- Conditions: e.g. "App version >= 2.0 AND Country == BR → true; otherwise false"
Publish the template to make changes live. Drafts don't reach clients.
5. Targeting by audience
Conditions support:
- Platform (iOS, Android, Web)
- App version (
==,>=,<=, semver) - Country / region
- User audience (defined via Firebase Analytics events)
- User property (custom, set from client)
- Random percentile (for gradual rollouts)
Set a custom user property from the client (requires @react-native-firebase/analytics):
import analytics from "@react-native-firebase/analytics";
await analytics().setUserProperty("tier", "pro");Then in console, create a condition: User property "tier" exactly matches "pro".
6. Gradual rollout pattern
To ship a feature to 10% of users:
- Add parameter
feature_x_enabled, defaultfalse - Add condition:
User in random percentile <= 10 → true - Publish. Monitor crash rate, latency, conversion for 24h.
- Increase percentile to 50, then 100.
Combine with a manual override condition (User property "qa_tester" exactly matches "true" → true) so QA can always test the feature.
For the full rollout sequence (internal → 1% → 10% → A/B → 100%) with rollback runbook see references/rollout-playbook.md.
7. Read from a Cloud Function
You can read Remote Config server-side via the Admin SDK to keep client and server in sync:
import { getRemoteConfig } from "firebase-admin/remote-config";
const template = await getRemoteConfig().getTemplate();
const param = template.parameters.feature_new_checkout;For dynamic decisions in Cloud Functions, prefer Firestore documents — Remote Config templates are designed for client targeting, not for high-QPS server reads.
8. Common mistakes
- No defaults in
setDefaults. First app launch (no network) gets undefined values → crashes. - Calling
fetch()withoutactivate(). The fetched template sits dormant. UsefetchAndActivate()unless you have a specific reason to delay activation (e.g. only activate on next app start). - Forgetting to publish the console template. Edits in the console don't reach clients until you hit "Publish changes".
- 12-hour cache in development. Set
minimumFetchIntervalMillisto 0 in dev or you'll think your changes aren't working. - Putting secrets in parameters. Anyone with mitmproxy can read them. Use Cloud Functions + Secret Manager for secrets.
- Treating Remote Config as a database. It's a key/value store with one template per project. Per-user data goes in Firestore.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

