Overview
The Siren JS SDK enhances Siren’s capabilities by providing advanced notification management functionalities within JavaScript applications. It offers seamless integration, robust error handling, and compatibility with Siren’s ecosystem.Installation
Usage
Initialization
Constructor Options
Property | Description | Type | Required |
---|---|---|---|
token | Siren user token | string | Yes |
recipientId | Siren recipient ID | string | Yes |
onError | Error callback function | Function | Yes |
actionCallbacks | Callbacks for notifications and counts | Object | No |
Methods
fetchUnviewedNotificationsCount()
Retrieves the count of unviewed notifications.fetchAllNotifications(options)
Retrieves a paginated list of notifications.Options
Parameter | Description | Type | Default |
---|---|---|---|
page | Current page number | number | 0 |
size | Items per page | number | 10 |
start | Filter notifications after this date (ISO string) | string | null |
end | Filter notifications before this date (ISO string) | string | null |
isRead | Filter by read status | boolean | null |
category | Filter by category | string | null |