appNotifications module reads a user’s in-app notification feed (comments, replies, mentions, reactions, follows, connection requests, milestones, and system messages) and marks notifications as read.
Every function acts on behalf of a named user. Pass that user’s Sublay ID as
userId — the feed and counts returned are that user’s.fetchNotifications
Returns a paginated list of a user’s notifications, newest first.The Sublay user ID whose notifications to fetch.
Page number (1-indexed). Defaults to
1.Results per page. Defaults to
20.Promise<PaginatedResponse<UnifiedAppNotification>>
Each notification is a discriminated union on type (e.g. "entity-comment", "comment-reply", "new-follow", "connection-request", "system"), with a metadata object whose shape depends on the type. See the App Notification data model for the full set of variants.
countUnreadNotifications
Returns the number of unread notifications for a user.The Sublay user ID.
Promise<number>
markNotificationAsRead
Marks a single notification as read.The ID of the notification to mark as read.
The Sublay user ID who owns the notification.
Promise<void>
markAllNotificationsAsRead
Marks all of a user’s unread notifications as read.The Sublay user ID whose notifications to mark as read.
Promise<{ markedAsRead: number }>
