A Firebase project is a Google Cloud project that has some additional Firebase-specific configurations and services enabled. This is commonly called "adding Firebase" to a Google Cloud project. This page describes how to "add Firebase", along with some frequently asked questions (FAQs).
When you add Firebase to a Google Cloud project, Firebase automatically enables
several APIs and creates service accounts to simplify the use of all Firebase
services and interfaces. Firebase also adds a
firebase:enabled
label
to your project within the
Labels page
of the Google Cloud console. Learn more details about
what happens when you "add Firebase".
Relationship between a Firebase project and a Google Cloud project
Since a Firebase project is a Google Cloud project:
You can access and interact with the project in the Firebase console as well as in the Google Cloud console and Google APIs console.
You can interact with the project using the Firebase CLI, the gcloud CLI, and any Terraform resource from Google.
You can use products and APIs from both Firebase and Google Cloud in the project.
IAM permissions and roles for the project are shared across Firebase and Google Cloud. Any access a project member (that is, a principal) has to your Google Cloud project will also apply to your Firebase project (and vice-versa).
Billing for the project is shared across Firebase and Google Cloud. If billing is enabled on your Google Cloud project, then your Firebase project will be on Firebase's pay-as-you-go Blaze pricing plan.
Unique identifiers for the project (like project number and project ID) are shared across Firebase and Google Cloud.
Any resource hierarchy applied to your Google Cloud project (for example, organization, folders, etc.) will also apply to your Firebase project.
Deleting the project deletes it across Firebase and Google Cloud.
Deleting or modifying a resource or data within the project applies across Firebase and Google Cloud.
How to add Firebase to an existing Google Cloud project
You can "add Firebase" to an existing Google Cloud project using any of the following options. Make sure that you have the required permissions to add Firebase to the Google Cloud project.
Be aware that once you "add Firebase" to an existing Google Cloud project, it can't be undone (that is, you can't fully "remove Firebase" from the Google Cloud project). Learn more in this FAQ.
Firebase console
Go to the Firebase console.
Sign in with the same Google Account that allows you to access the existing Google Cloud project.
Click Create a project.
At the bottom of the page, click the link for Already have a Google Cloud project?
In the text field, start entering the project ID of the existing project, and then select the project from the displayed list.
Click Open project.
If prompted, accept the Firebase Terms.
Follow the on-screen instructions to "add Firebase" and set up a Firebase project.
Note that enabling Google Analytics is optional.
Firebase CLI
If you haven't already, install the Firebase CLI.
Log in with the same Google Account that allows you to access the existing Google Cloud project.
Run the following command:
firebase projects:addfirebase
When prompted, select the existing Google Cloud project from the displayed list.
REST API
Enable the Firebase Management API in the existing Google Cloud project.
Generate your API access token.
Enable Firebase services for the project by calling
projects.addFirebase
.Note that you'll need the resource name of your project to make this call.
For detailed instructions, see Add Firebase services to your project in the Firebase guide: "Set up and manage a Firebase project using the Management REST API". Make sure to follow all the instructions in the Before you begin section of that guide.
Terraform
Enable the Firebase Management API (
firebase.googleapis.com
) in the existing Google Cloud project.Enable Firebase services for the project using the
google_firebase_project
resource.
For detailed information about using Firebase and Terraform, see Get started with Terraform and Firebase.
FAQs and troubleshooting
In order to access and use all capabilities of Firebase in a Google Cloud project, you need to accept the Firebase Terms of Service. You also need to accept the Firebase Terms in order to "add Firebase" to an existing Google Cloud project.
You only need to accept the Firebase Terms once for your Google Account no matter how many projects you have access to. When you accept the terms, you're accepting them only for your Google Account; acceptance is not at the project-level for all project members.
You can accept the Firebase Terms through the Firebase console using any of the following options. When prompted, accept the Terms.
Create a new Firebase project using the Firebase console.
Open an existing Firebase project in the Firebase console (for example, someone has invited you to become a project member (that is, a principal) on the project).
Open an existing Google Cloud in the Firebase console and "add Firebase" to it.
To "add Firebase" to an existing Google Cloud project, a project member (that is, a principal) must have the following IAM permissions:
firebase.projects.update
resourcemanager.projects.get
serviceusage.services.enable
serviceusage.services.get
The IAM roles of Editor and Owner contain these permissions by default.
All Firebase projects have a
firebase:enabled
label within
the
Labels page
of the Google Cloud console.
However, just manually adding the firebase:enabled
label to your list of
project labels does NOT enable Firebase-specific configurations and services for
your Google Cloud project. To do that, you need to
add Firebase using the Firebase console (or, for
advanced use cases, using the Firebase CLI, Firebase Management REST API, or
Terraform).
A Firebase project is a Google Cloud project that has some additional Firebase-specific configurations and services enabled. So, when you "add Firebase" to an existing Google Cloud project, Firebase takes the following actions to simplify the use of all Firebase services and interfaces:
Adds the
firebase:enabled
label within the Labels page of the Google Cloud console.Creates a "Browser" API key and auto-restricts it to the Firebase-related APIs.
Creates the following service accounts:
service-PROJECT_NUMBER@gcp-sa-firebase.iam.gserviceaccount.com
firebase-adminsdk-random5chars@PROJECT_ID.iam.gserviceaccount.com
Enables the following APIs:
- App Engine Admin API
- Cloud Pub/Sub API
- Cloud Resource Manager API
- Cloud Runtime Configuration API
- Cloud Testing API
- Firebase Cloud Messaging API
- Firebase Dynamic Links API
- Firebase Hosting API
- Firebase Installations API
- Firebase Management API
- Firebase Remote Config API
- Firebase Remote Config Realtime API
- Firebase Rules API
- Identity Toolkit API
- Token Service API
After you "add Firebase" to an existing Google Cloud project, it can't be undone (that is, you can't fully "remove Firebase" from the Google Cloud project).
The process of "adding Firebase" enables APIs and backend services that may be used for other Google Cloud features. Disabling all these enabled services could cause unexpected and unintended consequences due to dependencies.
However, if you choose, it is possible for you to manually disable all the APIs and delete the label, API key, and service accounts automatically enabled and created when you "added Firebase".
Yes, you can block the possibility of "adding Firebase" to an existing Google Cloud project. Here are some options:
Block the enablement of the
firebase.googleapis.com
API using a "Restrict allowed Google Cloud APIs and services" constraint.Limit the project members (that is, principals) that have the IAM permission
firebase.projects.update
, which is required to "add Firebase". You can use an IAM deny policy to do this efficiently.
Next steps
Check out the following resources for learning more about Firebase projects:
Understand Firebase projects — provides brief overviews of several important concepts about Firebase projects, including their relationship with Google Cloud and the basic hierarchy of a project and its apps and resources.
General best practices for setting up Firebase projects — provides general, high-level best practices for setting up Firebase projects and registering your apps with a project so that you have a clear development workflow that uses distinct environments.
Get started using Firebase in your mobile and web apps by registering your apps with your Firebase project and connecting them to Firebase: iOS+ | Android | Web | Flutter | Unity | C++.