After you set up Gemini in Firebase, you can start using it to enhance your Firebase developer experience.
To open the Gemini pane:
- Click ✦Gemini in Firebase, located in the upper right menu of the Firebase console.
The Gemini pane opens and persists across all pages in the Firebase console. You can now chat with Gemini and explore all of the features available in the Gemini pane.
If ✦Gemini in Firebase doesn't appear in the Firebase console, follow the steps in Set up Gemini in Firebase for a project to enable it.
Chat with Gemini
After you've opened the Gemini pane, you can immediately start a conversation with Gemini and begin asking questions using natural language.
The following steps demonstrate a conversation you might have with Gemini about Cloud Firestore. In this example, you ask Gemini to provide you with a basic set of Firestore rules and refine them together as you add requirements:
In the Ask me anything about Firebase field, enter a question and then click send Send. For example, you might ask something like the following:
When should I use a Remote Config rollout vs. an A/B Test?
Gemini displays its response.
Next, you can ask Gemini clarifying questions to expand on the conversation or paste code in and ask for advice.
You can continue the conversation, and continue sharing information and questions about the app and projects you're working on as you troubleshoot and Gemini will suggest improvements and optimizations and additional guidance.
Explore the Gemini pane in the Firebase console
The Gemini pane in the Firebase console has a number of features that simplify working collaboratively with the Gemini model.
Option | Action |
---|---|
notifications | View Firebase alerts. |
spark | Open Gemini in Firebase chat. |
contact_support | Get help: Search the developer documentation, contact support, and check Firebase service status. |
dark_mode | Choose a theme: Select a light or dark theme, or choose the device default. |
Clear the conversation. When you clear the conversation, all previous context is cleared and a new conversation session begins. | |
text_select_start | Dock the Gemini pane to a specific location on the console. You can choose to dock the pane to the left, top, right, or bottom. |
text_select_move_back_word | Undock the Gemini pane to return it to its original state. |
fullscreen | Maximize the Gemini pane to take up the entire console. |
fullscreen_exit | Restore the Gemini pane to its original size. |
Report an issue to the Firebase team about your experience with Gemini in Firebase. We encourage you to report bugs, suggest improvements, or provide general feedback. | |
close | Close the Gemini pane. |
Use AI assistance in Crashlytics
To use AI assistance in Crashlytics to generate insights about your crashes:
Open the Crashlytics dashboard in your project and select your app.
Locate and select a crash you want to investigate. The Crashlytics event page appears, providing a Generate AI insights button.
If you don't see a Generate AI insights button, verify that Gemini in Firebase has been enabled (for setup instructions, see Set up Gemini in Firebase). Also, make sure that you're viewing an Apple or Android event. Flutter, Unity, and Android NDK events and non-fatal events are not yet supported. And finally, ensure that the Insights section is expanded in the Crashlytics event page.
Click the Generate AI insights button.
Insights appear, with one or more of the following:
- an analysis of the crash with a possible cause
- debugging instructions
- actionable next steps
- best practices
If you want to provide code and context to obtain deeper insights, click Get started in the Want deeper insights? box.
Paste the code that Gemini in Firebase requests into the code field.
If you have more context or additional details to share that might help improve AI insights, add it to the Share any context or relevant details field.
Click Regenerate AI insights.
Gemini in Firebase generates updated insights based on your provided code and context.
Learn more at Get AI assistance in Crashlytics.
Get AI insights for messaging campaigns with Gemini in Firebase
Gemini in Firebase (with a Gemini Code Assist subscription) provides messaging campaign summarization, insights, and guidance to improve your Firebase Cloud Messaging and In-App Messaging campaign performance. By analyzing campaign data, Gemini in Firebase can help you understand your campaigns' reach and impact and suggests strategies to improve user engagement and growth.
Access AI insights for messaging campaigns
To use messaging campaign AI insights, make sure that your project has the following:
Gemini in Firebase is enabled for your project. Learn more at Set up Gemini in Firebase.
Firebase Cloud Messaging or In-App Messaging is enabled in your Firebase project.
At least one campaign exists and appears in the Firebase console.
After ensuring these requirements are met:
Open Messaging in the Firebase console to access campaign data.
After your campaign data loads, click Generate AI insights.
A summary and analysis of your messaging campaigns appears.
Generate GraphQL queries and mutations for Data Connect with Gemini in Firebase
To use AI assistance for Data Connect in the Firebase console to generate GraphQL based on natural language:
Open Data Connect in your project and, under Services, select your data source.
Click Data.
Click the Help me write GraphQLpen_spark icon.
Inside the text field that appears, describe the query or mutation you want to generate in natural language and click Generate.
For example, if you're using the Movies data source referenced in the Firebase Data Connect quickstart and the Build with Data Connect codelab, you could ask, "Return the top five movies of 2022, in descending order by rating," which might return a result like the following:
query TopMovies2022 { movies(where: {releaseYear: {eq: 2022}}, orderBy: [{rating: DESC}], limit: 5) { id title rating releaseYear } }
Review the response:
- If the response looks correct, click Insert to insert the response into the code editor.
- If the response could be refined, click Edit, update the prompt, and click Regenerate.
After you've accepted the response, set the following in the Parameters section, if applicable:
- Variables: If your query or mutation contains variables, define
them here. Use JSON to define them, for example,
{"title":"The Matrix", "releaseYear":"1999"}
. - Authorization: Choose the Authorization context (Administrator, Authenticated, or Unauthenticated) with which to run the query or mutation.
- Variables: If your query or mutation contains variables, define
them here. Use JSON to define them, for example,
Click Run in the code editor and review results.
To test multiple queries or mutations in the code editor, ensure they are
named. For example, the following query is named GetMovie
. Move your
cursor into the first line of the query or mutation to activate the Run
button.
query GetMovie($myKey: Movie_Key!) {
movie(key: $myKey) { title }
}
For more advanced use cases, see AI assistance for Data Connect in the Firebase console use cases.