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
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
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.
[null,null,["Last updated 2022-07-27 UTC."],[],[],null,["- firebase \n`firebase` is a global namespace from which all Firebase\nservices are accessed.\n\nIndex\n\nModules\n\n- [User](/docs/reference/js/v8/firebase.User)\n- [analytics](/docs/reference/js/v8/firebase.analytics)\n- [app](/docs/reference/js/v8/firebase.app)\n- [appCheck](/docs/reference/js/v8/firebase.appcheck)\n- [auth](/docs/reference/js/v8/firebase.auth)\n- [database](/docs/reference/js/v8/firebase.database)\n- [firestore](/docs/reference/js/v8/firebase.firestore)\n- [functions](/docs/reference/js/v8/firebase.functions)\n- [installations](/docs/reference/js/v8/firebase.installations)\n- [messaging](/docs/reference/js/v8/firebase.messaging)\n- [performance](/docs/reference/js/v8/firebase.performance)\n- [remoteConfig](/docs/reference/js/v8/firebase.remoteconfig)\n- [storage](/docs/reference/js/v8/firebase.storage)\n\nInterfaces\n\n- [FirebaseError](/docs/reference/js/v8/firebase.FirebaseError)\n- [FirebaseIdToken](/docs/reference/js/v8/firebase.FirebaseIdToken)\n- [UserInfo](/docs/reference/js/v8/firebase.UserInfo)\n\nType aliases\n\n- [EmulatorMockTokenOptions](/docs/reference/js/v8/firebase#emulatormocktokenoptions)\n- [FirebaseSignInProvider](/docs/reference/js/v8/firebase#firebasesigninprovider)\n- [LogLevel](/docs/reference/js/v8/firebase#loglevel)\n\nVariables\n\n- [SDK_VERSION](/docs/reference/js/v8/firebase#sdk_version)\n- [apps](/docs/reference/js/v8/firebase#apps)\n\nFunctions\n\n- [initializeApp](/docs/reference/js/v8/firebase#initializeapp)\n- [onLog](/docs/reference/js/v8/firebase#onlog)\n- [registerVersion](/docs/reference/js/v8/firebase#registerversion)\n- [setLogLevel](/docs/reference/js/v8/firebase#setloglevel)\n\nType aliases\n\nEmulatorMockTokenOptions \nEmulatorMockTokenOptions: { user_id: string } \\| { sub: string } \\& Partial\\\u003c[FirebaseIdToken](/docs/reference/js/v8/firebase.FirebaseIdToken)\\\u003e\n\nFirebaseSignInProvider \nFirebaseSignInProvider: \"custom\" \\| \"email\" \\| \"password\" \\| \"phone\" \\| \"anonymous\" \\| \"google.com\" \\| \"facebook.com\" \\| \"github.com\" \\| \"twitter.com\" \\| \"microsoft.com\" \\| \"apple.com\"\n\nLogLevel \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\nSDK_VERSION \nSDK_VERSION: string \nThe current SDK version.\n\napps \napps: [App](/docs/reference/js/v8/firebase.app.App)\\[\\] \nA (read-only) array of all initialized apps.\n\nFunctions\n\ninitializeApp\n\n- initializeApp ( options : Object , name ? : string ) : [App](/docs/reference/js/v8/firebase.app.App)\n- Creates and initializes a Firebase [app](/docs/reference/js/v8/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 options: Object \n Options to configure the app's services.\n -\n\n Optional name: string \n Optional name of the app to initialize. If no name\n is provided, the default is `\"[DEFAULT]\"`.\n\n Returns [App](/docs/reference/js/v8/firebase.app.App)\n\n The initialized app.\n\nonLog\n\n- onLog ( logCallback : ( callbackParams : { args : any \\[\\] ; level : [LogLevel](/docs/reference/js/v8/firebase#loglevel) ; message : string ; type : string } ) =\\\u003e void , options ? : { level : [LogLevel](/docs/reference/js/v8/firebase#loglevel) } ) : void\n- Sets log handler for all Firebase packages.\n\n Parameters\n -\n\n logCallback: (callbackParams: { args: any\\[\\]; level: [LogLevel](/docs/reference/js/v8/firebase#loglevel); message: string; type: string }) =\\\u003e void \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/js/v8/firebase#loglevel); message: string; type: string }): void\n\n \u003c!-- --\u003e\n\n -\n\n Parameters\n -\n\n callbackParams: { args: any\\[\\]; level: [LogLevel](/docs/reference/js/v8/firebase#loglevel); message: string; type: string }\n -\n\n args: any\\[\\] \n The raw arguments passed to the log call.\n -\n\n level: [LogLevel](/docs/reference/js/v8/firebase#loglevel) \n Level of event logged.\n -\n\n message: string \n Any text from logged arguments joined into one string.\n -\n\n type: string \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 Optional options: { level: [LogLevel](/docs/reference/js/v8/firebase#loglevel) }\n -\n\n level: [LogLevel](/docs/reference/js/v8/firebase#loglevel) \n Threshhold log level. Only logs at or above this level trigger the `logCallback`\n passed to `onLog`.\n\n Returns void\n\nregisterVersion\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 library: string \n Name of 1p or 3p library (e.g. firestore, angularfire)\n -\n\n version: string \n Current version of that library.\n -\n\n Optional variant: string \n Bundle variant, e.g., node, rn, etc.\n\n Returns void\n\nsetLogLevel\n\n- setLogLevel ( logLevel : [LogLevel](/docs/reference/js/v8/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 logLevel: [LogLevel](/docs/reference/js/v8/firebase#loglevel)\n\nReturns void"]]
firebase
is a global namespace from which all Firebase services are accessed.