Bell icon with unread count badge, popover notification list, and server-side notification creation utilities.
This page covers the in-app notification center (bell icon + in_app_notifications table). For Web Push (browser/mobile push notifications) see PWA & Push. For the transactional email retry queue see Background Jobs — the process-pending-emails handler.
Bell Icon + Badge
Red unread count badge (capped at 99+). Popover with scrollable notification list. Polls every 60s.
Notification Types
Info, success, warning, error, system — each with distinct icon and color. Relative time display.
Mark as Read
Click to mark individual, or "Mark all as read" button. Safe link navigation (relative paths only).
Server Utility
createInAppNotification() for single user, createNotificationForAccountMembers() for team-wide. Content sanitized before storage.
| API Route | Method | Description |
|---|---|---|
/api/notifications | GET | Fetch latest 50 notifications (unread first) |
/api/notifications | PATCH | Mark as read ({ ids: [...] } or { all: true }) |
read column. Content sanitized (title: 200 chars, message: 1000 chars). Links restricted to relative paths. RLS: users read/update own, service role inserts.