# useNotifications

## Function: useNotifications()

> **useNotifications**<`T`>(`mapper`, `isSignedIn`, `address`?, `limit`?, `refetchInterval`?, `filters`?): `object`

Custom hook to manage notifications using the Haven1 SDK.

### Type Parameters

• **T**

### Parameters

#### mapper

(`item`) => `T`

Function to map notification items.

#### isSignedIn

`boolean`

Indicates whether the user is signed in.

#### address?

`string`

Optional address associated with the notifications.

#### limit?

`number` = `5`

Optional limit for the number of notifications to fetch.

#### refetchInterval?

`number` = `...`

Optional interval in milliseconds for refetching notifications.

#### filters?

`Record`<`string`, `string`\[]> = `{}`

Optional filters applied to the notifications.

### Returns

`object`

#### newNotifications

> **newNotifications**: `object`\[]

#### newNotificationsCount

> **newNotificationsCount**: `undefined` | `string`

#### notifications

> **notifications**: `UseInfiniteQueryResult`<`InfiniteData`<{ `hasMore`: `boolean`; `items`: `never`\[]; `pageParam`: `number`; `rawItems`: `undefined`; } | { `hasMore`: `boolean`; `items`: `T`\[]; `pageParam`: `number`; `rawItems`: `object`\[]; }, `unknown`>, `Error`>

#### resetUnviewedNotifications()

> **resetUnviewedNotifications**: () => `void`

**Returns**

`void`

### Defined in

[packages/react/src/api/hook/useNotifications.tsx:10](https://github.com/haven1network/haven1-sdk/blob/7cd51fbeb78d9011a6b1c4b8e514287b0d830453/packages/react/src/api/hook/useNotifications.tsx#L10)
