voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
28 lines (16 loc) • 1.13 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/database](./database.md) > [getDatabase](./database.getdatabase.md)
## getDatabase() function
Returns the instance of the Realtime Database SDK that is associated with the provided [FirebaseApp](./app.firebaseapp.md)<!-- -->. Initializes a new instance with with default settings if no instance exists or if the existing instance uses a custom database URL.
<b>Signature:</b>
```typescript
export declare function getDatabase(app?: FirebaseApp, url?: string): FirebaseDatabase;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| app | FirebaseApp | The [FirebaseApp](./app.firebaseapp.md) 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. |
<b>Returns:</b>
[FirebaseDatabase](./database.firebasedatabase.md)
The `FirebaseDatabase` instance of the provided app.