Backend Sending Patterns
Your backend should send notifications from business events, not UI clicks.Backend endpoint and schema
From your backend API specs,POST /notifications accepts core fields like:
user_idtitlebodyseverityctasmetadata- expiry controls
Practical domain patterns
Security pattern
- password changed
- mfa enabled/disabled
- unknown sign-in detected
Collaboration pattern
- invite accepted
- role changed
- workspace membership updated
Operations pattern
- webhook endpoint disabled
- API key revoked/rotated
- automation failed and needs attention
Example
Option A: Direct HTTP call
Option B: Backend SDK (@wacht/backend)
Backend reliability rules
- Do not block critical domain transaction on notification send failures.
- Retry publish with bounded retry policy.
- Keep metadata stable and parsable.
- Avoid sending duplicate notifications for same event window.
Related docs
- Backend API Notifications Reference
- Frontend API Notifications Reference
- React Router
useNotifications - React Router
useNotificationStream
Go-live checklist
- Scope and severity conventions are documented.
- Inbox read/archive/star flows are tested.
- Realtime reconnection behavior is verified.
- Noisy template monitoring is in place.
- Expiry strategy is applied for stale notifications.
