Skip to content

js-bao-wss-client


js-bao-wss-client / NotificationsAPI

Interface: NotificationsAPI ​

Sub-API for the notification inbox (client.notifications.*).

Inbox reads/writes act on the signed-in user's own notifications. send() requires app admin permission. Live updates arrive as the notification client event (client.on("notification", ...)).

Methods ​

list() ​

list(options?): Promise<NotificationListResult>

List the caller's notifications, newest first.

Parameters ​

options? ​

NotificationListOptions

Returns ​

Promise<NotificationListResult>


listDevices() ​

listDevices(): Promise<{ items: PushDeviceInfo[]; }>

List the calling user's registered push devices.

Returns ​

Promise<{ items: PushDeviceInfo[]; }>


markAllRead() ​

markAllRead(): Promise<{ updated: number; }>

Mark all of the caller's notifications as read.

Returns ​

Promise<{ updated: number; }>


markRead() ​

markRead(notificationId): Promise<NotificationInfo>

Mark one of the caller's notifications as read.

Parameters ​

notificationId ​

string

Returns ​

Promise<NotificationInfo>


registerDevice() ​

registerDevice(params): Promise<PushDeviceInfo>

Register (upsert) the calling user's device push token.

Parameters ​

params ​

RegisterPushDeviceParams

Returns ​

Promise<PushDeviceInfo>


send() ​

send(params): Promise<{ deduplicated?: boolean; deduplicatedChannels?: string[]; results: NotificationSendResult[]; }>

Send a notification to an app user (requires app admin permission).

Parameters ​

params ​

SendNotificationParams

Returns ​

Promise<{ deduplicated?: boolean; deduplicatedChannels?: string[]; results: NotificationSendResult[]; }>


unreadCount() ​

unreadCount(): Promise<{ unreadCount: number; }>

Count the caller's unread notifications.

Returns ​

Promise<{ unreadCount: number; }>


unregisterDevice() ​

unregisterDevice(token): Promise<{ deleted: boolean; }>

Unregister one of the calling user's device push tokens (e.g. on logout).

Parameters ​

token ​

string

Returns ​

Promise<{ deleted: boolean; }>

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30