Push Notifications API
Web Push subscription and sending endpoints
Danvas provides two endpoints for managing Web Push notifications: subscribing a browser/device to receive notifications and sending notifications to users.
Web Push is app-owned infrastructure. It is used by staff messages, board announcement fanout, pre-shift companion alerts, and admin-triggered test notifications. It is not the Matrix Push Gateway API and does not configure Matrix pushers on the homeserver.
VAPID Keys
Push notifications use VAPID (Voluntary Application Server Identification) for security:
# Environment variables
NEXT_PUBLIC_VAPID_PUBLIC_KEY=<public key>
VAPID_PRIVATE_KEY=<private key>Generate keys with:
npx web-push generate-vapid-keysNotification Display
When received, the service worker displays a native notification. The payload should include a relative app URL so notification clicks can route the user back to the relevant Danvas screen: