Home > @firebase/database > getDatabase
getDatabase() function
Returns the instance of the Realtime Database SDK that is associated with the provided FirebaseApp. Initializes a new instance with with default settings if no instance exists or if the existing instance uses a custom database URL.
Signature:
export declare function getDatabase(app?: FirebaseApp, url?: string): FirebaseDatabase;
Parameters
Parameter | Type | Description |
---|---|---|
app | FirebaseApp | The FirebaseApp instance that the returned Realtime Database instance is associated with. |
url | string | The URL of the Realtime Database instance to connect to. If not provided, the SDK connects to the default instance of the Firebase App. |
Returns:
The FirebaseDatabase
instance of the provided app.