FirebaseApp interface

AFirebaseApp holds the initialization information for a collection of services.

Do not call this constructor directly. Instead, useinitializeApp() to create an app.

Signature:

exportinterfaceFirebaseApp

Properties

PropertyTypeDescription
automaticDataCollectionEnabledbooleanThe settable config flag for GDPR opt-in/opt-out
namestringThe (read-only) name for this app.The default app's name is"[DEFAULT]".
optionsFirebaseOptionsThe (read-only) configuration options for this app. These are the original parameters given ininitializeApp().

FirebaseApp.automaticDataCollectionEnabled

The settable config flag for GDPR opt-in/opt-out

Signature:

automaticDataCollectionEnabled:boolean;

FirebaseApp.name

The (read-only) name for this app.

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

Signature:

readonlyname:string;

Example 1

// The default app's name is "[DEFAULT]"constapp=initializeApp(defaultAppConfig);console.log(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"

FirebaseApp.options

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

Signature:

readonlyoptions:FirebaseOptions;

Example

constapp=initializeApp(config);console.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-01-19 UTC.