getNotifications()
getNotifications(
options?:GetNotificationsOptions):Promise<GetNotificationsResponse>
Defined in: packages/core/src/index.ts:1376
Get inbox notifications for the current user
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | GetNotificationsOptions | Pagination options (page, limit) |
Returns
Promise<GetNotificationsResponse>
Paginated notifications with unread count
Throws
401 - Not authenticated
Example
import { getNotifications } from "@cpod/sdk";
const response = await getNotifications({ page: 1, limit: 20 });
console.log(`You have ${response.unread_count} unread notifications`);
response.notifications.forEach(notification => {
console.log(`${notification.title}: ${notification.message}`);
});