Choose Firebase or Google Cloud
The two are separate. You can connect both to the same project, each with its own service account.
Prerequisites
- A Firebase project you want CloudThinker to inspect.
- Permission in that project’s Google Cloud to create service accounts and keys and to assign IAM roles.
- Service account key creation allowed. If your organization enforces
constraints/iam.disableServiceAccountKeyCreation(the default on organizations created since May 2024), ask an organization policy admin for an exception on this project first.
Setup
Decide first how to cover several projects. Most teams use one connection per project.- Google Cloud console
- gcloud CLI
1
Create a dedicated service account
In the Google Cloud console, select the Firebase project and go to IAM & Admin → Service Accounts. Click Create service account, name it
cloudthinker-firebase, and click Create and continue.2
Grant a read-only Firebase role
Add Firebase Viewer (
roles/firebase.viewer) and click Done. Add a write role only if you want CloudThinker to create apps or deploy through your approvals. See Required permissions.3
Create a JSON key
Open the service account, go to the Keys tab, and click Add key → Create new key. Choose JSON and click Create.Success state: your browser downloads a
.json key file.1
Open the connect dialog
In the sidebar, click More → Workspace settings → Connections, select Firebase, and click Connect.
2
Name the connection
Fill in Alias (for example
prod-firebase) and Description (for example Production Firebase project, mobile app). Agents read the description to pick the right connection when you have several.3
Upload the key
Drag the
.json file onto the upload area, or click choose a JSON file to browse for it. Click Connect.Success state: the connection shows Connected, and the key’s project_id is the active project. Discovery then runs once in the background and spends credits. It never waits for approval, so it skips project switches and deploy status checks. See What happens after you connect.4
Set the environment
Open Firebase in More → Workspace settings → Connections, click the pencil icon on the connection’s row, and set Environment in Edit Instance. It labels the connection for people and agents.
Connection details
You don’t need a separate project ID or a Firebase config file. To cover several projects, see the options in Setup.
Required permissions
Google requires more roles for some deploys. A Cloud Functions deploy, for example, also needs Cloud Functions Developer (
roles/cloudfunctions.developer) and Service Account User (roles/iam.serviceAccountUser).
Agent capabilities
CloudThinker uses the official Firebase CLI (firebase-tools) toolset through this connection.
The connection covers what
firebase-tools exposes. It doesn’t read Firestore documents, Authentication users, Crashlytics, or Remote Config.
Verify the connection
project_id as the active project.
Example prompts
Troubleshooting
CloudThinker says no active project is selected
CloudThinker says no active project is selected
Cause: the error reads
PRECONDITION_FAILED and mentions the active project. CloudThinker sets the active project from the key’s project_id each time the connection starts. If the saved key can’t be parsed, for example because it was edited before upload, no project is selected. The resource isn’t missing.Fix: for this prompt, name the project. Switching the active project goes through your approvals. To fix it for good, create a new JSON key and upload the downloaded file unchanged with Replace… in Edit Instance.Permission denied on a project, rules, or deploy
Permission denied on a project, rules, or deploy
Cause: the service account lacks the IAM role for that Firebase product, or the project isn’t visible to it.Fix: in Google Cloud console → IAM, grant Firebase Viewer for reads and rules, or Firebase Admin (or the narrower role in Required permissions) for creates and deploys. Then retry.
A project doesn't appear in the project list
A project doesn't appear in the project list
Cause: the service account has no role in that project.Fix: in that project’s Google Cloud console → IAM, grant the service account Firebase Viewer (
roles/firebase.viewer), then ask again.The test shows Timed out
The test shows Timed out
Cause: the test didn’t finish in time. Firebase endpoints are public, so it’s rarely your network.Fix: connect again. If it keeps timing out, contact us.
A create or deploy action didn't run
A create or deploy action didn't run
Cause: writes need both an IAM role that allows them and approval in CloudThinker. If you rejected the request, CloudThinker won’t retry it.Fix: check the service account’s roles, then ask again.
Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Protect the key: the JSON key is a full credential for the service account. Delete the local copy once it’s uploaded, and never commit it or paste it into chat.
- Rotate the key at least every 90 days: create a new key, upload it with Replace… in Edit Instance, then delete the old key. See Rotate a credential.
Related
Google Cloud connection
Connect the rest of your Google Cloud project.
Approvals
Control how approval-gated actions get decided.