[Documentation](https://fluxnative.app/docs) / Connect services

# Firebase

Paste a service-account key once; the assistant reads the config, publishes tested security rules and registers Android fingerprints for Google sign-in.

![The Firebase form in Server, with the Service account JSON box, Choose the json file, and Save and test](https://fluxnative.app/guide-media/firebase.4f72bced.webp)

Paste the whole service-account JSON, or choose the file, then Save and test.

## Steps

1. No Firebase project yet? In the [Firebase console](https://console.firebase.google.com), click **Create a project** (or **Add project**), name it after the app and wait until it is ready. Google Analytics is optional.
2. In the project, create the database once: **Build** › **Firestore Database** › **Create database**, in the location nearest your users. If people sign in, turn the method on under **Build** › **Authentication**.
3. Open **Project settings** › **Service accounts**, click **Generate new private key** and confirm. A JSON file downloads once.
4. In FluxNative, click **Server** › **Backend** › Firebase.
5. Paste the whole file, starting with `{`, and save. Not the Web API key or an OAuth client file.

## What the assistant does

- Writes the real app config into the project.
- Tests Firestore and Storage rules before publishing them; rules that fail to compile are refused.
- Registers the Android SHA fingerprint Google sign-in needs, shown in the Build panel under **Signing key**.
- Stores named secrets in Secret Manager for Cloud Functions.

## Good to know

- Android push always goes through Firebase Cloud Messaging, even when the data lives elsewhere. For push alone, **Connect Firebase** on **Push notifications** asks only for this key.
- Firestore, sign-in and Cloud Messaging are free on Spark. Storage, Cloud Functions and Secret Manager need the Blaze plan, with a card on file.
- The test says the key works but lacks permission? A project owner presses **Open IAM in Google Cloud** under the connection, then **Grant access**, pastes the account (the file's `client_email`), picks **Firebase Admin** and saves. Test again a few minutes later.
- **Generate new private key** says key creation is disabled? The Google Cloud organization blocks keys, the default for organizations made since May 2024: an organization admin allows them for this project.

**Warning:** The key controls the whole Google Cloud project. It never goes into the app or chat; revoke it by deleting the key on the same Firebase screen.

## Related

[Push notifications](https://fluxnative.app/docs/push-notifications) · [API keys and secrets](https://fluxnative.app/docs/secrets)

Previous: [Supabase](https://fluxnative.app/docs/supabase) · Next: [Appwrite](https://fluxnative.app/docs/appwrite)

---

Paste a service-account key once; the assistant reads the config, publishes tested security rules and registers Android fingerprints for Google sign-in.

Page: https://fluxnative.app/docs/firebase
