<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/database](./database.md) &gt; [ref](./database.ref.md)

## ref() function

Returns a `Reference` representing the location in the Database corresponding to the provided path. If no path is provided, the `Reference` will point to the root of the Database.

<b>Signature:</b>

```typescript
export declare function ref(db: FirebaseDatabase, path?: string): Reference;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  db | [FirebaseDatabase](./database.firebasedatabase.md) | The database instance to obtain a reference for. |
|  path | string | Optional path representing the location the returned <code>Reference</code> will point. If not provided, the returned <code>Reference</code> will point to the root of the Database. |

<b>Returns:</b>

[Reference](./database.reference.md)

If a path is provided, a `Reference` pointing to the provided path. Otherwise, a `Reference` pointing to the root of the Database.

