Understand Firebase projects (original) (raw)

This page offers brief overviews of several important concepts about Firebase projects. When available, follow the links to find more detailed information about features, services, tooling, and best practices.

Relationship between Firebase projects, apps, and products

A Firebase project is the top-level entity for Firebase. In a project, you can register your Apple, Android, or web apps. After you register your apps with Firebase, you can add the Firebase SDKs for any number ofFirebase products, like Analytics,Cloud Firestore, Performance Monitoring, or Remote Config.

Learn more detailed information about this process in the Getting Started guide for your platform:
iOS+ | Android |web | Unity | C++ |Flutter.

Understanding the hierarchy of Firebase projects

Diagram showing the basic hierarchy of a Firebase project, including
          the project, its registered apps, and its provisioned resources and
          servicesThis diagram shows the basic hierarchy of a Firebase project. Here are the key relationships:

Relationship between Firebase projects and Google Cloud

When you create a new Firebase project, you're actually creating aGoogle Cloud projectbehind the scenes. You can even create a Google Cloud project first, then add Firebase to the project later. You can think of a Google Cloud project as a virtual container for data, code, configuration, and services.

Note that for all Firebase projects, Firebase automatically adds a label offirebase:enabled within theLabels pagefor your project in the Google Cloud console. Learn more about this label in our FAQ.

Since a Firebase project is a Google Cloud project:

Setting up a Firebase project and registering apps

You can set up a Firebase project and register apps in the Firebase console(or, for advanced use cases, using theFirebase Management REST API or theFirebase CLI). When you set up a project and register apps, you need to make some organizational decisions and add Firebase-specific configuration information to your local projects.

For production apps, you need to set up a clear development workflow, which usually involves using multiple environments. Review our documentation ondeveloper workflows, includinggeneral best practicesandgeneral security guidelinesfor setting up Firebase projects and registering apps to create your development workflow.

Interacting with a Firebase project

Besides the product SDKs, you can directly interact with a Firebase project using several different tools and interfaces.

Firebase console

The Firebase console offers the richest environment for managing Firebase products, apps, and project-level settings.

The left-side panel of the console lists the Firebase products, organized by top-level categories. At the top of the left-side panel, access a project's settings by clicking . A project's settings includeintegrations,access permissions, and billing.

The middle of the console displays buttons that launch setup workflows to register various types of apps. After you start using Firebase, the main area of the console changes into a dashboard that displays stats on the products you use.

Note that since a Firebase project is also a Google Cloud project, you might find that various tasks or products require you to use theGoogle Cloud console instead of the Firebase console.

Firebase CLI (a command line tool)

Firebase also offers the Firebase CLI for configuring and managing specific Firebase products, like Firebase Hosting,Cloud Functions for Firebase, and Firebase Extensions.

After installing the CLI, you have access to theglobal firebase command. Use the CLI tolink your local app directory to a Firebase project, thendeploy new versions of Firebase-hosted content or updates to functions.

Firebase Management REST API

Using theFirebase Management REST API, you can programmatically manage a Firebase project. For example, you can programmatically register an app with a project or list the apps that are already registered (iOS+|Android|web).

Firebase project identifiers

A Firebase project can be identified in the Firebase backend and in various developer interfaces using different identifiers, including the project name, the project number, and the project ID.

The project name

When you create a project, you provide a project name. This identifier is the internal-only name for a project in theFirebase console, theGoogle Cloud console, and the Firebase CLI. The project name is not exposed in any publicly visible Firebase or Google Cloud product, service, or resource; it simply serves to help you more easily distinguish among multiple projects.

You can edit a project name at any time in theProject settings of theFirebase console. The project name is displayed in the top pane.

The project number

A Firebase project (and itsassociated Google Cloud project) has aproject number. This is the Google-assigned globally unique canonical identifier for the project. Use this identifier when configuring integrations and/or making API calls to Firebase, Google, or third-party services.

You cannot edit a project number. If you delete a project, the project number is also deleted and can never be used again by any other project.

Find the project number

Find your Firebase project's project number using one of these options:

API calls and the project number

For many API calls, you need to include a unique identifier for a project. Although many APIs accept the project ID, it's recommended that you use the project number for making API calls to Firebase, Google, or third-party services.

Learn more about using project identifiers, especially the project number, in Google's AIP 2510 standard.

The project ID

A Firebase project (and itsassociated Google Cloud project) has aproject ID. This is a user-defined unique identifier for the project across all of Firebase and Google Cloud. When you create a Firebase project, Firebase automatically assigns a unique ID to the project, but you can edit it during project setup. This identifier should generally be treated as a convenience alias to reference the project.

Find the project ID

Find your Firebase project's project ID using one of these options:

Firebase resources and the project ID

The project ID displays in publicly visible Firebase resources, for example:

For all of the aforementioned resources, you can create non-default instances. The publicly visible names of non-defaults are fully-customizable. You canconnect custom domains to a Firebase-hosted site,shard the Realtime Database, andcreate multiple Cloud Storage buckets (visit the platform-specific Get Started page).

The Firebase CLI and the project ID

For some use cases, you might have multiple Firebase projects associated with the same local app directory. In these situations, when you use theFirebase CLI, you need to pass the --project flag with thefirebase commands to communicate which Firebase project you want to interact with.

You can also set up a project alias for each Firebase project so that you don't have to remember project IDs.

API calls and the project ID

For many API calls, you need to include a unique identifier for a project. Although many APIs accept the project ID, it's recommended that you use theproject number for making API calls to Firebase, Google, or third-party services.

Learn more about using project identifiers, especially the project number, in Google's AIP 2510 standard.

Firebase config files and objects

When you register an app with a Firebase project, the Firebase console provides a Firebase configuration file (Apple/Android apps) or a configuration object (web apps) that you add directly to your local app directory.

At any time, you canobtain an app's Firebase config file or object.

A Firebase config file or object associates an app with a specific Firebase project and its resources (databases, storage buckets, etc.). The configuration includes "Firebase options", which are parameters required by Firebase and Google services to communicate with Firebase server APIs and to associate client data with the Firebase project and Firebase app. Here are the required, minimum "Firebase options":

The content of the Firebase config file or object is considered public, including the app's platform-specific ID (Apple bundle ID or Android package name) and the Firebase project-specific values, like the API Key, project ID,Realtime Database URL, and Cloud Storage bucket name. Given this,use Firebase Security Rules to protect your data and files inRealtime Database,Cloud Firestore, and Cloud Storage.

For open source projects, we generally do not recommend including the app's Firebase config file or object in source control because, in most cases, your users should create their own Firebase projects and point their apps to their own Firebase resources (via their own Firebase config file or object).

General limits for Firebase projects, apps, and sites

Here are some general limits for Firebase projects, apps, and sites:

Launching your app