# Firebase Remote Config

Use when implementing feature flags, running A/B tests, setting parameter defaults...

- Repository: https://github.com/evanca/flutter-ai-rules (668 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -g -a claude-code -y`
Codex: `npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -g -a codex -y`
Cursor: `npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -g -a cursor -y`
Gemini CLI: `npx skills add evanca/flutter-ai-rules --skill firebase-remote-config -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add evanca/flutter-ai-rules`

## Description

Use when implementing feature flags, running A/B tests, setting parameter defaults, fetching/activating config, or enabling real-time config updates.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Firebase Remote Config Skill

This skill defines how to correctly use Firebase Remote Config in Flutter applications.

## When to Use

Use this skill when:

* Implementing feature flags or remote configuration without deploying app updates.
* Managing parameter defaults and fetching remote values.
* Implementing real-time config updates for instant changes.
* Setting up A/B testing or conditional targeting for user segments.

---

## 1. Setup and Configuration

```
flutter pub add firebase_remote_config
flutter pub add firebase_analytics  # required for conditional targeting of app instances
```

```dart
import 'package:firebase_remote_config/firebase_remote_config.dart';

final remoteConfig = FirebaseRemoteConfig.instance;
```

- Enable **Google Analytics** in the Firebase project for user property and audience targeting.
- Ensure the **Remote Config REST API** is not disabled, the SDK depends on it.
- For **macOS**, enable Keychain Sharing in Xcode.

**Configure settings:**

```dart
await remoteConfig.setConfigSettings(RemoteConfigSettings(
  fetchTimeout: const Duration(minutes: 1),
  minimumFetchInterval: const Duration(hours: 1),
));
```

---

## 2. Parameter Management

**Set in-app defaults** (ensures the app behaves as intended before connecting to the backend):

```dart
await remoteConfig.setDefaults(const {
  "feature_new_onboarding": false,
  "max_retry_attempts": 3,
  "welcome_message": "Hello, world!",
  "promo_discount_pct": 0.0,
});
```

**Read values with type-specific getters:**

```dart
final showNewOnboarding = remoteConfig.getBool("feature_new_onboarding");
final maxRetries = remoteConfig.getInt("max_retry_attempts");
final welcomeMsg = remoteConfig.getString("welcome_message");
final discount = remoteConfig.getDouble("promo_discount_pct");
```

The rest: https://github.com/evanca/flutter-ai-rules/blob/HEAD/skills/firebase-remote-config/SKILL.md
