firebase
firebase is a global namespace from which all the Firebase services are accessed.
Class
Promise
A Promise represents an eventual (asynchronous) value. A Promise should (eventually) either resolve or reject. When it does, it will call all the callback functions that have been assigned via the .then() or
.catch() methods.
firebase.Promise is the same as the native Promise implementation when available in the current environment, otherwise it is a compatible implementation of the Promise/A+ spec.
Interfaces
FirebaseError
Thenable
User
UserInfo
Namespaces
app
auth
database
Properties
apps
non-null Array of firebase.app.App
A (read-only) array of all initialized apps.
SDK_VERSION
string
The current SDK version.
Method
initializeApp
initializeApp(options, name) returns firebase.app.App
Creates and initializes a Firebase app instance.
See Initialize the SDK and Initialize multiple apps for detailed documentation.
Parameter |
|
|---|---|
|
options |
Object Options to configure the app's services. Value must not be null. |
|
name |
Optional string Optional name of the app to initialize. If no name is provided, the default is |
- Returns
-
non-null firebase.app.AppThe initialized app.
Examples
// Initialize default app
// Retrieve your own options values by adding a web app on
// https://console.firebase.google.com
firebase.initializeApp({
apiKey: "AIza....", // Auth / General Use
authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
storageBucket: "YOUR_APP.appspot.com", // Storage
messagingSenderId: "123456789" // Cloud Messaging
});
// Initialize another app
var otherApp = firebase.initializeApp({
databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
}, "otherApp");

