Naar console

A Firebase app holds the initialization information for a collection of services.

Do not call this constructor directly. Instead, use admin.initializeApp() to create an app.

Index

Properties

name

name: string

The (read-only) name for this app.

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

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

options

options: AppOptions

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

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

Methods

auth

database

  • Parameters

    • Optional url: string

    Returns Database

delete

  • delete(): Promise<void>
  • Renders this local FirebaseApp unusable and frees the resources of all associated services (though it does not clean up any backend resources). When running the SDK locally, this method must be called to ensure graceful termination of the process.

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

    Returns Promise<void>

firestore

  • firestore(): admin.firestore.Firestore
  • Returns admin.firestore.Firestore

instanceId

messaging

projectManagement

storage