App interface

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

Signature:

exportinterfaceApp

Properties

PropertyTypeDescription
namestringThe (read-only) name for this app.The default app's name is"[DEFAULT]".
optionsAppOptionsThe (read-only) configuration options for this app. These are the original parameters given ininitializeApp().

App.name

The (read-only) name for this app.

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

Signature:

name:string;

Example 1

// The default app's name is "[DEFAULT]"initializeApp(defaultAppConfig);console.log(admin.app().name);// "[DEFAULT]"

Example 2

// A named app's name is what you provide to initializeApp()constotherApp=initializeApp(otherAppConfig,"other");console.log(otherApp.name);// "other"

App.options

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

Signature:

options:AppOptions;

Example

constapp=initializeApp(config);console.log(app.options.credential===config.credential);// trueconsole.log(app.options.databaseURL===config.databaseURL);// true

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-04-16 UTC.