// The default app's name is "[DEFAULT]"
firebase.initializeApp(defaultAppConfig);
console.log(firebase.app().name); // "[DEFAULT]"
example
// A named app's name is what you provide to initializeApp()var otherApp = firebase.initializeApp(otherAppConfig, "other");
console.log(otherApp.name); // "other"
options
options: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.databaseURL === config.databaseURL); // true
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-09-28 UTC."],[],[],null,["# App | JavaScript SDK\n\n- [firebase](/docs/reference/js/v8/firebase).\n- [app](/docs/reference/js/v8/firebase.app).\n- App\n================================================================================================\n\nA Firebase App holds the initialization information for a collection of\nservices.\n\nDo not call this constructor directly. Instead, use\n[`firebase.initializeApp()`](/docs/reference/js/v8/firebase#initializeapp) to create an app.\n\nIndex\n-----\n\n### Properties\n\n- [automaticDataCollectionEnabled](/docs/reference/js/v8/firebase.app.App#automaticdatacollectionenabled)\n- [name](/docs/reference/js/v8/firebase.app.App#name)\n- [options](/docs/reference/js/v8/firebase.app.App#options)\n\n### Methods\n\n- [analytics](/docs/reference/js/v8/firebase.app.App#analytics)\n- [appCheck](/docs/reference/js/v8/firebase.app.App#appcheck)\n- [auth](/docs/reference/js/v8/firebase.app.App#auth)\n- [database](/docs/reference/js/v8/firebase.app.App#database)\n- [delete](/docs/reference/js/v8/firebase.app.App#delete)\n- [firestore](/docs/reference/js/v8/firebase.app.App#firestore)\n- [functions](/docs/reference/js/v8/firebase.app.App#functions)\n- [installations](/docs/reference/js/v8/firebase.app.App#installations)\n- [messaging](/docs/reference/js/v8/firebase.app.App#messaging)\n- [performance](/docs/reference/js/v8/firebase.app.App#performance)\n- [remoteConfig](/docs/reference/js/v8/firebase.app.App#remoteconfig)\n- [storage](/docs/reference/js/v8/firebase.app.App#storage)\n\nProperties\n----------\n\n### automaticDataCollectionEnabled\n\nautomaticDataCollectionEnabled: boolean \nThe settable config flag for GDPR opt-in/opt-out\n\n### name\n\nname: string \nThe (read-only) name for this app.\n\nThe default app's name is `\"[DEFAULT]\"`.\n\nexample\n:\n\n // The default app's name is \"[DEFAULT]\"\n firebase.initializeApp(defaultAppConfig);\n console.log(firebase.app().name); // \"[DEFAULT]\"\n\n\nexample\n:\n\n // A named app's name is what you provide to initializeApp()\n var otherApp = firebase.initializeApp(otherAppConfig, \"other\");\n console.log(otherApp.name); // \"other\"\n\n\n### options\n\noptions: Object \nThe (read-only) configuration options for this app. These are the original\nparameters given in\n[`firebase.initializeApp()`](/docs/reference/js/v8/firebase#initializeapp).\n\nexample\n:\n\n var app = firebase.initializeApp(config);\n console.log(app.options.databaseURL === config.databaseURL); // true\n\n\nMethods\n-------\n\n### analytics\n\n- analytics ( ) : [Analytics](/docs/reference/js/v8/firebase.analytics.Analytics)\n- Gets the [`Analytics`](/docs/reference/js/v8/firebase.analytics.Analytics) service for the\n current app. If the current app is not the default one, throws an error.\n\n The Analytics SDK does not work in a Node.js environment.\n\n example\n :\n\n const analytics = app.analytics();\n // The above is shorthand for:\n // const analytics = firebase.analytics(app);\n\n\n #### Returns [Analytics](/docs/reference/js/v8/firebase.analytics.Analytics)\n\n### appCheck\n\n- appCheck ( ) : [AppCheck](/docs/reference/js/v8/firebase.appcheck.AppCheck)\n-\n\n #### Returns [AppCheck](/docs/reference/js/v8/firebase.appcheck.AppCheck)\n\n### auth\n\n- auth ( ) : [Auth](/docs/reference/js/v8/firebase.auth.Auth)\n- Gets the [`Auth`](/docs/reference/js/v8/firebase.auth.Auth) service for the current app.\n\n example\n :\n\n var auth = app.auth();\n // The above is shorthand for:\n // var auth = firebase.auth(app);\n\n\n #### Returns [Auth](/docs/reference/js/v8/firebase.auth.Auth)\n\n### database\n\n- database ( url ? : string ) : [Database](/docs/reference/js/v8/firebase.database.Database)\n- Gets the [`Database`](/docs/reference/js/v8/firebase.database.Database) service for the\n current app.\n\n example\n :\n\n var database = app.database();\n // The above is shorthand for:\n // var database = firebase.database(app);\n\n\n #### Parameters\n\n -\n\n ##### Optional url: string\n\n #### Returns [Database](/docs/reference/js/v8/firebase.database.Database)\n\n### delete\n\n- delete ( ) : Promise \\\u003c any \\\u003e\n- Renders this app unusable and frees the resources of all associated\n services.\n\n example\n :\n\n app.delete()\n .then(function() {\n console.log(\"App deleted successfully\");\n })\n .catch(function(error) {\n console.log(\"Error deleting app:\", error);\n });\n\n\n #### Returns Promise\\\u003cany\\\u003e\n\n### firestore\n\n- firestore ( ) : [Firestore](/docs/reference/js/v8/firebase.firestore.Firestore)\n-\n\n #### Returns [Firestore](/docs/reference/js/v8/firebase.firestore.Firestore)\n\n### functions\n\n- functions ( regionOrCustomDomain ? : string ) : [Functions](/docs/reference/js/v8/firebase.functions.Functions)\n-\n\n #### Parameters\n\n -\n\n ##### Optional regionOrCustomDomain: string\n\n #### Returns [Functions](/docs/reference/js/v8/firebase.functions.Functions)\n\n### installations\n\n- installations ( ) : [Installations](/docs/reference/js/v8/firebase.installations.Installations)\n- Gets the [`Installations`](/docs/reference/js/v8/firebase.installations.Installations) service for the\n current app.\n\n The Installations SDK does not work in a Node.js environment.\n\n example\n :\n\n const installations = app.installations();\n // The above is shorthand for:\n // const installations = firebase.installations(app);\n\n\n #### Returns [Installations](/docs/reference/js/v8/firebase.installations.Installations)\n\n### messaging\n\n- messaging ( ) : [Messaging](/docs/reference/js/v8/firebase.messaging.Messaging)\n- Gets the [`Messaging`](/docs/reference/js/v8/firebase.messaging.Messaging) service for the\n current app.\n\n The Messaging SDK does not work in a Node.js environment.\n\n example\n :\n\n var messaging = app.messaging();\n // The above is shorthand for:\n // var messaging = firebase.messaging(app);\n\n\n #### Returns [Messaging](/docs/reference/js/v8/firebase.messaging.Messaging)\n\n### performance\n\n- performance ( ) : [Performance](/docs/reference/js/v8/firebase.performance.Performance)\n- Gets the [`Performance`](/docs/reference/js/v8/firebase.performance.Performance) service for the\n current app. If the current app is not the default one, throws an error.\n\n The Performance SDK does not work in a Node.js environment.\n\n example\n :\n\n const perf = app.performance();\n // The above is shorthand for:\n // const perf = firebase.performance(app);\n\n\n #### Returns [Performance](/docs/reference/js/v8/firebase.performance.Performance)\n\n### remoteConfig\n\n- remoteConfig ( ) : [RemoteConfig](/docs/reference/js/v8/firebase.remoteconfig.RemoteConfig)\n- Gets the [`RemoteConfig`](/docs/reference/js/v8/firebase.remoteconfig.RemoteConfig) instance.\n\n The Remote Config SDK does not work in a Node.js environment.\n\n example\n :\n\n const rc = app.remoteConfig();\n // The above is shorthand for:\n // const rc = firebase.remoteConfig(app);\n\n\n #### Returns [RemoteConfig](/docs/reference/js/v8/firebase.remoteconfig.RemoteConfig)\n\n### storage\n\n- storage ( url ? : string ) : [Storage](/docs/reference/js/v8/firebase.storage.Storage)\n- Gets the [`Storage`](/docs/reference/js/v8/firebase.storage.Storage) service for the current\n app, optionally initialized with a custom storage bucket.\n\n example\n :\n\n var storage = app.storage();\n // The above is shorthand for:\n // var storage = firebase.storage(app);\n\n\n example\n :\n\n var storage = app.storage(\"gs://your-app.appspot.com\");\n\n\n #### Parameters\n\n -\n\n ##### Optional url: string\n\n The gs:// url to your Firebase Storage Bucket.\n If not passed, uses the app's default Storage Bucket.\n\n #### Returns [Storage](/docs/reference/js/v8/firebase.storage.Storage)"]]
A Firebase App holds the initialization information for a collection of services.
Do not call this constructor directly. Instead, use
firebase.initializeApp()
to create an app.