A Firebase App holds the initialization information for a collection ofservices.
Do not call this constructor directly. Instead, usefirebase.initializeApp() to create an app.
Index
Properties
automaticDataCollectionEnabled
The settable config flag for GDPR opt-in/opt-out
name
The (read-only) name for this app.
The default app's name is"[DEFAULT]".
- example
// 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
The (read-only) configuration options for this app. These are the originalparameters given infirebase.initializeApp().
- example
var app = firebase.initializeApp(config);console.log(app.options.databaseURL === config.databaseURL);// true
Methods
appCheck
- app
Check():firebase.appCheck.AppCheck Returnsfirebase.appCheck.AppCheck
auth
database
delete
- delete():Promise<any>
Renders this app unusable and frees the resources of all associatedservices.
- example
app.delete() .then(function(){console.log("App deleted successfully"); }) .catch(function(error){console.log("Error deleting app:", error); });
ReturnsPromise<any>
firestore
functions
storage
- storage(url?: string):Storage
Gets the
Storageservice for the currentapp, optionally initialized with a custom storage bucket.- example
var storage = app.storage();// The above is shorthand for:// var storage = firebase.storage(app);- example
var storage = app.storage("gs://your-app.appspot.com");
Parameters
Optional url:string
The gs:// url to your Firebase Storage Bucket.If not passed, uses the app's default Storage Bucket.
ReturnsStorage
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 2022-07-27 UTC.