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.
Modular JavaScript SDK
Early Access Program
Firebase App
Common use cases
Core
Initialization
EAP Modular
v8 Current
import { initializeApp } from 'firebase/app' ;
const firebaseApp = initializeApp ( { } ) ;
import firebase from 'firebase/app' ;
const firebaseApp = firebase. initializeApp ( { } ) ;
Get an existing app
EAP Modular
v8 Current
import { getApp } from 'firebase/app' ;
const firebaseApp = getApp ( ) ;
import firebase from 'firebase/app' ;
const firebaseApp = firebase. apps[ 0 ] ;
Create a named app
EAP Modular
v8 Current
import { initializeApp } from 'firebase/app' ;
const firebaseApp = initializeApp ( { } , 'named-app' ) ;
import firebase from 'firebase/app' ;
const firebaseApp = firebase. initializeApp ( { } , 'named-app' ) ;
Get an existing named app
EAP Modular
v8 Current
import { getApps } from 'firebase/app' ;
const namedApp = getApps. find ( app => app. name === 'named-app' ) ;
import firebase from 'firebase/app' ;
const namedApp = firebase. apps. find ( app => app. name === 'named-app' ) ;