Real-Time Updates (Mercure SSE)
PSAPLink uses Mercure Server-Sent Events for live dashboard updates. No polling required.
How It Works
- On login, the frontend subscribes to a Mercure topic derived from the user's ID
- Cloud publishes SSE events to that topic when relevant state changes
- The frontend updates the UI immediately
Published Events
| Event | When |
|---|---|
| Incident created | New incident dispatched to a company |
| Notification sent | Delivery attempt made |
| ACK received | User acknowledged via any channel |
| Reply received | Company user sent a reply |
| PSAP ACK | PSAP TCO acknowledged a reply |
| Escalation triggered | Timeout with no ACK |
Payload Encryption
SSE payloads for sensitive topics are encrypted before publishing to Mercure.
- Keys rotate every 30 minutes, derived deterministically from the master encryption key
- Wire format:
enc:<base64(nonce[24] || ciphertext)> - Frontend uses
libsodium-wrappersto decrypt; keys fetched viaGET /api/v1/realtime/subscribe-key - Keys auto-refresh 60 seconds before expiry via the
useSseKeyhook
Configuration
MERCURE_JWT_SECRET=your-shared-secret
MERCURE_URL=http://mercure/.well-known/mercure # internal
MERCURE_PUBLIC_URL=https://psaplink.com/.well-known/mercure