Before you start using Gemini in Firebase, you must enable it in the
Firebase console. Gemini in Firebase is enabled on a per-user,
per-project basis and is available at no cost to all users.

## Required permissions

To enable and use features of Gemini in Firebase requires certain IAM roles
and permissions.

- Project members with the [owner or editor IAM role](https://firebase.google.com/docs/projects/iam/roles-basic.md.txt) can enable Gemini in Firebase and use its features.
- Project viewers cannot enable Gemini in Firebase. However, they can use its features, including [Gemini in Firebase chat](https://firebase.google.com/docs/ai-assistance/gemini-in-firebase/try-gemini.md.txt), and [AI assistance in Crashlytics](https://firebase.google.com/docs/crashlytics/ai-assistance-in-dashboard.md.txt).

## Set up Gemini in Firebase

After ensuring that your account has
[required permissions](https://firebase.google.com/docs/ai-assistance/gemini-in-firebase/set-up-gemini.md.txt#required-permissions), you can enable
Gemini in Firebase for your project.

Perform the following to enable Gemini in Firebase usage for your project.

1. As a project owner or editor, open the
   [Firebase console](https://console.firebase.google.com/), select a project,
   and click ✦**Gemini in Firebase**
   located in the upper-right console menu.

   The Gemini pane appears.
2. Review the information that appears and click **Get started**.

You are now ready to accelerate your Firebase development with
Gemini in Firebase. Learn more about interacting with Gemini in Firebase
at
[Try Gemini in the Firebase console](https://firebase.google.com/docs/ai-assistance/gemini-in-firebase/try-gemini.md.txt).

## Turn off Gemini in Firebase

To turn off all Gemini for Google Cloud products including
Gemini in Firebase and features that it supports, like
[AI assistance in Crashlytics](https://firebase.google.com/docs/crashlytics/ai-assistance-in-dashboard.md.txt),
see
[Turn off the Gemini for Google Cloud API](https://cloud.google.com/gemini/docs/turn-off-gemini#companion-api).

> [!NOTE]
> **Note:** If you turn off the Gemini for Google Cloud API, then you disable all Gemini for Google Cloud features.

## Troubleshoot Gemini in Firebase

> [!NOTE]
> **Note:** While Gemini in Firebase can answer questions about Firebase Security Rules, it is unable to generate Security Rules because it doesn't have access to your specific codebase. To generate Security Rules for Cloud Firestore and Cloud Storage, use an AI coding agent that can access your codebase, such as Google Antigravity. For more information, refer to [AI Prompt: Write Firebase Security Rules](https://firebase.google.com/docs/ai-assistance/prompt-catalog/write-security-rules.md.txt).

If ✦**Gemini in Firebase** doesn't appear in the Firebase console, verify
that the **Gemini for Google Cloud API** is enabled in the
[Google Cloud console](https://console.cloud.google.com/apis/api/cloudaicompanion.googleapis.com?project=_).

## Next steps

- [Try Gemini in the Firebase console](https://firebase.google.com/docs/ai-assistance/gemini-in-firebase/try-gemini.md.txt).
- Learn more about [prompt optimization](https://cloud.google.com/gemini/docs/discover/write-prompts).