Realtime (SSE)
Microbase broadcasts record changes over Server-Sent Events (SSE) at /api/realtime.
Connection Flow
Section titled “Connection Flow”- Open an
EventSourceto/api/realtime(or/api/realtime?token=<JWT>for authenticated subscriptions). - Receive the initial
PB_CONNECTevent containing yourclientId. - Subscribe to collections or individual records via
POST /api/realtime:
curl -X POST http://localhost:3000/api/realtime \ -H "Authorization: Bearer <JWT>" \ -H "Content-Type: application/json" \ -d '{ "clientId": "<CLIENT_ID>", "subscriptions": ["posts", "posts/RECORD_ID"] }'Limits & Protection
Section titled “Limits & Protection”- Max 20 concurrent SSE connections per IP and 1,000 global connections to protect against connection exhaustion.
- Every delivered event is evaluated against the subscriber’s collection
view_rule.