Send feedback
Stay organized with collections
Save and categorize content based on your preferences.
Type aliases
EmulatorMockTokenOptions
Emulator
MockTokenOptions: { user_id: string } | { sub: string } & Partial < FirebaseIdToken >
FirebaseSignInProvider
FirebaseSignInProvider: "custom" | "email" | "password" | "phone" | "anonymous" | "google.com" | "facebook.com" | "github.com" | "twitter.com" | "microsoft.com" | "apple.com"
LogLevel
LogLevel: "debug" | "verbose" | "info" | "warn" | "error" | "silent"
Variables
SDK_VERSION
SDK_VERSION: string
Functions
appCheck
appCheck
(
app
?
:
App
)
:
firebase.appCheck.AppCheck
Parameters
Returns firebase.appCheck.AppCheck
initializeApp
initializeApp
(
options
:
Object
,
name
?
:
string
)
:
App
Parameters
options: Object
Optional name: string
Returns App
The initialized app.
onLog
onLog
(
logCallback
:
(
callbackParams
:
{
args
:
any
[]
;
level
:
LogLevel
;
message
:
string
;
type
:
string
}
)
=>
void
,
options
?
:
{
level
:
LogLevel
}
)
:
void
Parameters
logCallback: ( callbackParams: { args: any [] ; level: LogLevel ; message: string ; type: string } ) => void
( callbackParams: { args: any [] ; level: LogLevel ; message: string ; type: string } ) : void
Parameters
callbackParams: { args: any [] ; level: LogLevel ; message: string ; type: string }
args: any []
message: string
type: string
Returns void
Optional options: { level: LogLevel }
Returns void
registerVersion
registerVersion
(
library
:
string
,
version
:
string
,
variant
?
:
string
)
:
void
Parameters
library: string
version: string
Optional variant: string
Returns void
setLogLevel
setLogLevel
(
logLevel
:
LogLevel
)
:
void
Parameters
Returns void
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-27 UTC.
Need to tell us more?
[[["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 2022-07-27 UTC."],[],[],null,["# firebase | JavaScript SDK\n\n- firebase\n==========\n\n`firebase` is a global namespace from which all Firebase\nservices are accessed.\n\nIndex\n-----\n\n### Modules\n\n- [User](/docs/reference/node/firebase.User)\n- [app](/docs/reference/node/firebase.app)\n- [auth](/docs/reference/node/firebase.auth)\n- [database](/docs/reference/node/firebase.database)\n- [firestore](/docs/reference/node/firebase.firestore)\n- [functions](/docs/reference/node/firebase.functions)\n- [storage](/docs/reference/node/firebase.storage)\n\n### Interfaces\n\n- [FirebaseError](/docs/reference/node/firebase.FirebaseError)\n- [FirebaseIdToken](/docs/reference/node/firebase.FirebaseIdToken)\n- [UserInfo](/docs/reference/node/firebase.UserInfo)\n\n### Type aliases\n\n- [EmulatorMockTokenOptions](/docs/reference/node/firebase#emulatormocktokenoptions)\n- [FirebaseSignInProvider](/docs/reference/node/firebase#firebasesigninprovider)\n- [LogLevel](/docs/reference/node/firebase#loglevel)\n\n### Variables\n\n- [SDK_VERSION](/docs/reference/node/firebase#sdk_version)\n- [apps](/docs/reference/node/firebase#apps)\n\n### Functions\n\n- [appCheck](/docs/reference/node/firebase#appcheck)\n- [initializeApp](/docs/reference/node/firebase#initializeapp)\n- [onLog](/docs/reference/node/firebase#onlog)\n- [registerVersion](/docs/reference/node/firebase#registerversion)\n- [setLogLevel](/docs/reference/node/firebase#setloglevel)\n\nType aliases\n------------\n\n### EmulatorMockTokenOptions\n\nEmulatorMockTokenOptions: { user_id: string } \\| { sub: string } \\& Partial\\\u003c[FirebaseIdToken](/docs/reference/node/firebase.FirebaseIdToken)\\\u003e\n\n### FirebaseSignInProvider\n\nFirebaseSignInProvider: \"custom\" \\| \"email\" \\| \"password\" \\| \"phone\" \\| \"anonymous\" \\| \"google.com\" \\| \"facebook.com\" \\| \"github.com\" \\| \"twitter.com\" \\| \"microsoft.com\" \\| \"apple.com\"\n\n### LogLevel\n\nLogLevel: \"debug\" \\| \"verbose\" \\| \"info\" \\| \"warn\" \\| \"error\" \\| \"silent\" \nThe JS SDK supports 5 log levels and also allows a user the ability to\nsilence the logs altogether.\n\nThe order is as follows:\nsilent \\\u003c debug \\\u003c verbose \\\u003c info \\\u003c warn \\\u003c error\n\nVariables\n---------\n\n### SDK_VERSION\n\nSDK_VERSION: string \nThe current SDK version.\n\n### apps\n\napps: [App](/docs/reference/node/firebase.app.App)\\[\\] \nA (read-only) array of all initialized apps.\n\nFunctions\n---------\n\n### appCheck\n\n- appCheck ( app ? : [App](/docs/reference/node/firebase.app.App) ) : firebase.appCheck.AppCheck\n-\n\n #### Parameters\n\n -\n\n ##### Optional app: [App](/docs/reference/node/firebase.app.App)\n\n #### Returns firebase.appCheck.AppCheck\n\n### initializeApp\n\n- initializeApp ( options : Object , name ? : string ) : [App](/docs/reference/node/firebase.app.App)\n- Creates and initializes a Firebase [app](/docs/reference/node/firebase.app.App) instance.\n\n See\n [Add Firebase to your app](https://firebase.google.com/docs/web/setup#add_firebase_to_your_app) and\n [Initialize multiple projects](https://firebase.google.com/docs/web/learn-more#multiple-projects) for detailed documentation.\n\n example\n :\n\n\n // Initialize default app\n // Retrieve your own options values by adding a web app on\n // https://console.firebase.google.com\n firebase.initializeApp({\n apiKey: \"AIza....\", // Auth / General Use\n appId: \"1:27992087142:web:ce....\", // General Use\n projectId: \"my-firebase-project\", // General Use\n authDomain: \"YOUR_APP.firebaseapp.com\", // Auth with popup/redirect\n databaseURL: \"https://YOUR_APP.firebaseio.com\", // Realtime Database\n storageBucket: \"YOUR_APP.appspot.com\", // Storage\n messagingSenderId: \"123456789\", // Cloud Messaging\n measurementId: \"G-12345\" // Analytics\n });\n\n\n example\n :\n\n\n // Initialize another app\n var otherApp = firebase.initializeApp({\n apiKey: \"AIza....\",\n appId: \"1:27992087142:web:ce....\",\n projectId: \"my-firebase-project\",\n databaseURL: \"https://\u003cOTHER_DATABASE_NAME\u003e.firebaseio.com\",\n storageBucket: \"\u003cOTHER_STORAGE_BUCKET\u003e.appspot.com\"\n }, \"nameOfOtherApp\");\n\n\n #### Parameters\n\n -\n\n ##### options: Object\n\n Options to configure the app's services.\n -\n\n ##### Optional name: string\n\n Optional name of the app to initialize. If no name\n is provided, the default is `\"[DEFAULT]\"`.\n\n #### Returns [App](/docs/reference/node/firebase.app.App)\n\n The initialized app.\n\n### onLog\n\n- onLog ( logCallback : ( callbackParams : { args : any \\[\\] ; level : [LogLevel](/docs/reference/node/firebase#loglevel) ; message : string ; type : string } ) =\\\u003e void , options ? : { level : [LogLevel](/docs/reference/node/firebase#loglevel) } ) : void\n- Sets log handler for all Firebase packages.\n\n #### Parameters\n\n -\n\n ##### logCallback: (callbackParams: { args: any\\[\\]; level: [LogLevel](/docs/reference/node/firebase#loglevel); message: string; type: string }) =\\\u003e void\n\n An optional custom log handler that executes user code whenever\n the Firebase SDK makes a logging call.\n -\n - (callbackParams: { args: any\\[\\]; level: [LogLevel](/docs/reference/node/firebase#loglevel); message: string; type: string }): void\n\n \u003c!-- --\u003e\n\n -\n\n #### Parameters\n\n -\n\n ##### callbackParams: { args: any\\[\\]; level: [LogLevel](/docs/reference/node/firebase#loglevel); message: string; type: string }\n\n -\n\n ##### args: any\\[\\]\n\n The raw arguments passed to the log call.\n -\n\n ##### level: [LogLevel](/docs/reference/node/firebase#loglevel)\n\n Level of event logged.\n -\n\n ##### message: string\n\n Any text from logged arguments joined into one string.\n -\n\n ##### type: string\n\n A string indicating the name of the package that made the log call,\n such as `@firebase/firestore`.\n\n #### Returns void\n\n -\n\n ##### Optional options: { level: [LogLevel](/docs/reference/node/firebase#loglevel) }\n\n -\n\n ##### level: [LogLevel](/docs/reference/node/firebase#loglevel)\n\n Threshhold log level. Only logs at or above this level trigger the `logCallback`\n passed to `onLog`.\n\n #### Returns void\n\n### registerVersion\n\n- registerVersion ( library : string , version : string , variant ? : string ) : void\n- Registers a library's name and version for platform logging purposes.\n\n #### Parameters\n\n -\n\n ##### library: string\n\n Name of 1p or 3p library (e.g. firestore, angularfire)\n -\n\n ##### version: string\n\n Current version of that library.\n -\n\n ##### Optional variant: string\n\n Bundle variant, e.g., node, rn, etc.\n\n #### Returns void\n\n### setLogLevel\n\n- setLogLevel ( logLevel : [LogLevel](/docs/reference/node/firebase#loglevel) ) : void\n- Sets log level for all Firebase packages.\n\n All of the log types above the current log level are captured (i.e. if\n you set the log level to `info`, errors are logged, but `debug` and\n `verbose` logs are not).\n\n #### Parameters\n\n -\n\n ##### logLevel: [LogLevel](/docs/reference/node/firebase#loglevel)\n\n #### Returns void"]]
firebase
is a global namespace from which all Firebase services are accessed.