The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Firebase App

Common use cases

Core

Initialization

import { initializeApp } from 'firebase/app';
const firebaseApp = initializeApp({ /* config */ });

Get an existing app

import { getApp } from 'firebase/app';
const firebaseApp = getApp();

Create a named app

import { initializeApp } from 'firebase/app';
const firebaseApp = initializeApp({ /* config */ }, 'named-app');

Get an existing named app

import { getApps } from 'firebase/app';
const namedApp = getApps.find(app => app.name === 'named-app');