Firebase Tutorial
- Home
- Introduction
- Project Setup
- Authentication (Email/Pass)
- Social Authentication
- Cloud Firestore (Basics)
- Firestore Queries
- Real-time Updates
- Firestore Security Rules
- Cloud Storage
- Storage Security Rules
- Cloud Functions (Intro)
- Triggering Functions
- Firebase Hosting
- Firebase Analytics
- Crashlytics & Performance
- Remote Config
- App Check
- Offline Persistence
- Firebase with Next.js
- Best Practices
Remote Config
Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update.
1. Use Cases
- Feature Toggles: Enable or disable features for specific user segments.
- Design Changes: Change the theme or layout for seasonal promotions.
- A/B Testing: Test different versions of a feature to see which performs better.
2. Basic Implementation
import { getRemoteConfig, getValue, fetchAndActivate } from "firebase/remote-config";
const remoteConfig = getRemoteConfig();
remoteConfig.settings.minimumFetchIntervalMillis = 3600000; // 1 hour
fetchAndActivate(remoteConfig)
.then(() => {
const welcomeMessage = getValue(remoteConfig, "welcome_msg").asString();
console.log(welcomeMessage);
});3. Setting Default Values
Always provide default values for when a device is offline or config hasn't been fetched yet.
remoteConfig.defaultConfig = {
"welcome_msg": "Welcome to our App!"
};Pro Tip: Use Remote Config with A/B Testing to validate product changes before rolling them out to all users.