# Remote Config, Analytics and Crashlytics — Firebase

Source: https://www.skillbyai.com/en/firebase/ho-features

> Change, measure, stabilise.

## Operational features at a glance

**Remote Config** stores parameters in the console that apps fetch at runtime, so you can toggle features, run staged rollouts and target conditions without shipping a new build. Always provide in-app defaults, and remember the values are readable by clients, so they are not secrets or access control. **Google Analytics for Firebase** logs events (`logEvent`) and user properties for funnels and audiences; respect consent requirements. **Crashlytics** collects crash reports for Android, Apple, Flutter and Unity apps (not a web product; check the docs for platform support). Together they support careful releases: flag a feature, watch analytics and crash-free rates, then widen the rollout.

## A feature flag with defaults

TypeScript, web SDK.

```typescript
import { getRemoteConfig, fetchAndActivate, getValue } from "firebase/remote-config";
import { getAnalytics, logEvent } from "firebase/analytics";

const rc = getRemoteConfig(app);
rc.settings.minimumFetchIntervalMillis = 60 * 60 * 1000; // lower only in development
rc.defaultConfig = { new_checkout: false, banner_text: "" };

await fetchAndActivate(rc);
if (getValue(rc, "new_checkout").asBoolean()) {
  showNewCheckout();
}

const analytics = getAnalytics(app);
logEvent(analytics, "checkout_started", { variant: "new" });
```

## Flags are not permissions

A user can change what their client does with a flag. Enforce access in rules or functions, and use flags only to choose behaviour.

**Quiz:** Why are in-app defaults important for Remote Config?

- [ ] Defaults encrypt the values
- [x] The app must behave sensibly before or without a successful fetch
- [ ] Fetches are impossible without them
- [ ] Defaults replace Security Rules

*Answer:* The app must behave sensibly before or without a successful fetch. Networks fail; defaults keep the app working.
