[PERS SDK - v2.3.26](/sdk-reference/readme) / [Exports](/sdk-reference/modules) / NotificationService

# Class: NotificationService

Notification Service - Business logic layer for the notification inbox

Caches the resolved `channelId` per session (stable per-recipient per-tenant,
per the SDK integration guide) to avoid refetching it on every WS (re)connect.

## Table of contents

### Constructors

- [constructor](/sdk-reference/classes/notificationservice#constructor)


### Methods

- [getChannelId](/sdk-reference/classes/notificationservice#getchannelid)
- [getNotifications](/sdk-reference/classes/notificationservice#getnotifications)
- [getUnreadCount](/sdk-reference/classes/notificationservice#getunreadcount)
- [markAsRead](/sdk-reference/classes/notificationservice#markasread)
- [deleteNotification](/sdk-reference/classes/notificationservice#deletenotification)
- [sendNotification](/sdk-reference/classes/notificationservice#sendnotification)


## Constructors

### constructor

• **new NotificationService**(`notificationApi`): [`NotificationService`](/sdk-reference/classes/notificationservice)

#### Parameters

| Name | Type |
|  --- | --- |
| `notificationApi` | [`NotificationApi`](/sdk-reference/classes/notificationapi) |


#### Returns

[`NotificationService`](/sdk-reference/classes/notificationservice)

#### Defined in

[notification/services/notification-service.ts:22](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L22)

## Methods

### getChannelId

▸ **getChannelId**(`forceRefresh?`): `Promise`<`null` | `string`>

Get the Besu channelId for the authenticated account.
Cached in-memory for the lifetime of this service instance.

#### Parameters

| Name | Type | Default value |
|  --- | --- | --- |
| `forceRefresh` | `boolean` | `false` |


#### Returns

`Promise`<`null` | `string`>

#### Defined in

[notification/services/notification-service.ts:28](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L28)

### getNotifications

▸ **getNotifications**(`options?`): `Promise`<`PaginatedResponseDTO`<`NotificationDTO`>>

#### Parameters

| Name | Type |
|  --- | --- |
| `options?` | [`NotificationQueryOptions`](/sdk-reference/interfaces/notificationqueryoptions) |


#### Returns

`Promise`<`PaginatedResponseDTO`<`NotificationDTO`>>

#### Defined in

[notification/services/notification-service.ts:36](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L36)

### getUnreadCount

▸ **getUnreadCount**(): `Promise`<`NotificationUnreadCountDTO`>

#### Returns

`Promise`<`NotificationUnreadCountDTO`>

#### Defined in

[notification/services/notification-service.ts:40](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L40)

### markAsRead

▸ **markAsRead**(`id`): `Promise`<`NotificationDTO`>

#### Parameters

| Name | Type |
|  --- | --- |
| `id` | `string` |


#### Returns

`Promise`<`NotificationDTO`>

#### Defined in

[notification/services/notification-service.ts:44](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L44)

### deleteNotification

▸ **deleteNotification**(`id`): `Promise`<`void`>

#### Parameters

| Name | Type |
|  --- | --- |
| `id` | `string` |


#### Returns

`Promise`<`void`>

#### Defined in

[notification/services/notification-service.ts:51](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L51)

### sendNotification

▸ **sendNotification**(`dto`): `Promise`<`NotificationDTO`>

#### Parameters

| Name | Type |
|  --- | --- |
| `dto` | `SendNotificationDTO` |


#### Returns

`Promise`<`NotificationDTO`>

#### Defined in

[notification/services/notification-service.ts:58](https://github.com/eXplorins/PERS-sdks/blob/main/packages/pers-sdk/packages/pers-sdk/src/notification/services/notification-service.ts#L58)