-
-
SDK
-
Authentication
-
Database
- Cloud Firestore
- Realtime Database
-
Cloud Storage
-
-
FirebaseAppProvider
- Performance Monitoring
- Authentication
- Cloud Storage
When called from a component nested inside a FirebaseAppProvider
, useFirebaseApp
returns the root Firebase object.
IMPORTANT: By default,
useFirebaseApp
returns a firebase object without any products attached to it (e.g. you can't callfirebase.firestore()
. To do that, you need to import a Firebase feature (import 'firebase/firestore'
) or lazy load a feature with one of the Hooks below)
Throws a Promise by default
Returns firebase.analytics
When called from a component nested inside a FirebaseAppProvider
. If firebase.analytics
doesn't exist, it lazy loads the Analytics SDK.
Throws a Promise by default
Returns firebase.auth
When called from a component nested inside a FirebaseAppProvider
. If firebase.auth
doesn't exist, it lazy loads the Auth SDK.
Throws a Promise by default
Returns firebase.database
When called from a component nested inside a FirebaseAppProvider
. If firebase.database
doesn't exist, it lazy loads the Realtime Database SDK.
Throws a Promise by default
Returns firebase.firestore
When called from a component nested inside a FirebaseAppProvider
. If firebase.firestore
doesn't exist, it lazy loads the Cloud Firestore SDK.
Throws a Promise by default
Returns firebase.functions
When called from a component nested inside a FirebaseAppProvider
. If firebase.functions
doesn't exist, it lazy loads the Cloud Functions for Firebase SDK.
Throws a Promise by default
Returns firebase.messaging
When called from a component nested inside a FirebaseAppProvider
. If firebase.messaging
doesn't exist, it lazy loads the Firebase Cloud Messaging SDK.
Throws a Promise by default
Returns firebase.performance
When called from a component nested inside a FirebaseAppProvider
. If firebase.performance
doesn't exist, it lazy loads the Performance Monitoring SDK.
Throws a Promise by default
Returns firebase.remoteConfig
When called from a component nested inside a FirebaseAppProvider
. If firebase.remoteConfig
doesn't exist, it lazy loads the Remote Config SDK.
Throws a Promise by default
Returns firebase.storage
When called from a component nested inside a FirebaseAppProvider
. If firebase.storage
doesn't exist, it lazy loads the Storage SDK.
Get the user that is currently signed in. Lazy loads the firebase/auth
SDK if it is not already loaded.
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
auth ? | Auth |
[optional] auth object. If not provided, useUser will use useFirebaseApp to find the Auth object. |
options ? | ReactFireOptions | Options. This hook will not throw a Promise if you provide startWithValue . |
Listen to a Firestore Document.
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
ref | DocumentReference |
A reference to the document you want to listen to |
options ? | ReactFireOptions | Options. This hook will not throw a Promise if you provide startWithValue . |
Listen to a Firestore Collection.
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
ref | Query |
A query for the collection you want to listen to |
options ? | ReactFireOptions | Options. This hook will not throw a Promise if you provide startWithValue . |
Listen to a Realtime Database Object.
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
ref | Reference |
A reference to the object you want to listen to |
options ? | ReactFireOptions | Options. This hook will not throw a Promise if you provide startWithValue . |
Listen to a Realtime Database list.
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
ref | Reference |
A reference to the list you want to listen to |
options ? | ReactFireOptions | Options. This hook will not throw a Promise if you provide startWithValue . |
Listen to a Storage UploadTask
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
task | UploadTask |
|
ref | Reference |
|
options ? | ReactFireOptions |
Subscribe to a storage blob's download URL
Throws a Promise by default
Parameter | Type | Description |
---|---|---|
ref | Reference |
|
options ? | ReactFireOptions |
string
Property | Type |
---|---|
startWithValue | any |
A React Context Provider that allows the useFirebaseApp
hook to pick up the firebase
object.
const firebaseConfig = {
/* web app config from Firebase console */
};
<FirebaseAppProvider firebaseConfig={firebaseConfig} initPerformance>
<App />
</FirebaseAppProvider>;
Prop | Type | Description |
---|---|---|
config | Object | the web app config object usually passed to initializeApp |
initPerformance | bool | Whether or not to initialize Firebase Performance Monitoring |
Renders children
if a user is signed in and meets the required claims. Renders fallback
otherwise.
Property | Type |
---|---|
auth | Auth |
children | React.Component |
fallback | React.Component |
requiredClaims | Object |
Renders an image based on a Cloud Storage path.
Property | Type |
---|---|
storagePath | string |
storage? | firebase.storage.Storage |
...and any other props a normal React <img>
element can take.
Starts a Firebase Performance Monitoring trace and ends it when suspense stops suspending.
Property | Type |
---|---|
children | React.Component |
fallback | React.Component |
firePerf ? | any |
traceId | string |
Start importing the firebase/analytics
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.analytics
>
Start importing the firebase/auth
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.auth
>
Start importing the firebase/database
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.database
>
Start importing the firebase/firestore
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.firestore
>
Start importing the firebase/functions
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.functions
>
Start importing the firebase/messaging
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.messaging
>
Start importing the firebase/performance
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.performance
>
Start importing the firebase/remoteConfig
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.remoteConfig
>
Start importing the firebase/storage
package.
Parameter | Type | Description |
---|---|---|
firebaseApp | firebase.app.App |
The Firebase object |
Promise<
firebase.storage
>