Properties

name

string

The (read-only) name for this app.

The default app's name is "[DEFAULT]".

Examples

// The default app's name is "[DEFAULT]"
firebase.initializeApp(defaultAppConfig);
console.log(firebase.app().name);  // "[DEFAULT]"
// A named app's name is what you provide to initializeApp()
var otherApp = firebase.initializeApp(otherAppConfig, "other");
console.log(otherApp.name);  // "other"

options

non-null Object

The (read-only) configuration options for this app. These are the original parameters given in firebase.initializeApp().

Example

var app = firebase.initializeApp(config);
console.log(app.options.credential === config.credential);  // true
console.log(app.options.databaseURL === config.databaseURL);  // true

Methods

auth

auth() returns firebase.auth.Auth

Gets the Auth service for the current app.

Returns

non-null firebase.auth.Auth 

Example

var auth = app.auth();
// The above is shorthand for:
// var auth = firebase.auth(app);

database

database() returns firebase.database.Database

Gets the Database service for the current app.

Returns

non-null firebase.database.Database 

Example

var database = app.database();
// The above is shorthand for:
// var database = firebase.database(app);

delete

delete() returns firebase.Promise containing void

Renders this app unusable and frees the resources of all associated services.

Returns

non-null firebase.Promise containing void An empty promise fulfilled when the app has been deleted.

Example

app.delete()
  .then(function() {
    console.log("App deleted successfully");
  })
  .catch(function(error) {
    console.log("Error deleting app:", error);
  });