Notifications router

An overview of the Notifications router

Procedures

The notifications router has the following procedures:

Get the notifications inbox

Returns all the notifications for the current user.

// Client components
const { data } = api.notifications.inbox.useQuery()
// Server components
const data = await api.notifications.inbox()

Mark a notification as read

Marks a notification as read.

  • Access: @protected
// Client components
const { data } = api.notifications.markAsRead.useMutation({
notificationId: 'notification-id',
})
// Server components
const data = await api.notifications.markAsRead({
notificationId: 'notification-id',
})

Was this helpful?