Skip to content

Use Firebase to build your app on your own Firebase project, with Firebase sign-in and a Firestore database. To connect an existing project with a key, the project needs a default Firestore database in Native mode and a service account with Firebase Admin access.

Connect Firebase

To connect your Firebase project to your app as a connection:

  1. Open Project Settings › Connections, and then turn on the switch for Firebase.
  2. In the Connect Firebase dialog, choose how to connect:
    • Set up with Google: select Create a new project, or select Use an existing project, click Choose with Google, and then pick the project under Existing Google Cloud project. Choose a Firestore location, click Connect, and then allow the setup when Google asks. The setup doesn’t link a billing account.
    • Paste a service account key (JSON): paste the contents of your key’s JSON file into Service account key (JSON), and then click Connect. Find it opens the service accounts page in the Firebase console.

For more about connecting, see Connect a service.

Agent access

The agent can’t use your Firebase connection until an owner of your app allows it under Agent access, which is off by default. When it’s on, the agent can read the project’s settings, apps, security rules and indexes, and the documents in its Firestore database, which can include your app users’ data. What the agent reads is sent to the AI model.

The agent can also register apps, turn on email sign-in, create indexes and replace the security rules. Only a thread that an owner started can make these changes, and each change waits for that owner’s approval. An approved change applies to your Firebase project right away, not when you push, and can affect other apps that use the same project.

To allow the agent:

  1. In Project Settings › Connections, click Options on the Firebase card, and then select Settings.
  2. Under Agent access, click Allow the agent, and then click Allow.

To stop the agent, click Turn off. The agent stops at once, and changes that are waiting for approval don’t run. Agent access also turns off when you replace the connection’s key, until an owner allows it again.

What to ask

After Agent access is on, click Set up Firebase in my app at the top of the Firebase page. A new thread opens with this request filled in, ready for you to send:

Example request

Set up Firebase sign-in (email and password) and a Firestore database in my app. Check the existing rules before changing them, and tell me what happens to existing users and data.

Your existing Firebase users and data stay where they are. Google sign-in is set up separately from Firebase sign-in.

Agent questions

If Firebase isn’t connected, the agent asks you to connect it in a Connect card above the message box. Before each change to your Firebase project, it asks under Approval, and you click Approve or Decline. See Answer the agent.

Review

After the agent finishes, read the turn’s Summary and review its Changes, and then try sign-in in Preview. The preview uses your real Firebase project, with its real users and data.

In the preview, email and password sign-in works, but social sign-in and email sign-in links don’t finish.

Push

When sign-in and your data work, push the changes to your app.

Next steps

Troubleshooting

For a refused key or a connection that needs attention, see Troubleshoot connections.