Subscribe to context updates for a user (tRPC WebSocket)
wss://api.kontext.dev/trpc
(tRPC WS endpoint), procedure: data.contextUpdates
x-api-key
sent as a WS connectionParams
value (not an HTTP header){ userId: string }
{ type: 'facts_updated' | 'profile_changed' | 'data_synced', userId: string, timestamp: string, metadata?: { factCount?: number; source?: string; changeType?: string } }
REDIS_HOST
configured.metadata
may evolve; treat as opaque unless documented.useRealtimeContext()
creates a WS client that sets x-api-key
in connectionParams
.{ userId }
and updates state on new events./trpc/data.contextUpdates
— subscriptions won’t work over HTTP.{ userId }
via WS”.REDIS_HOST
is not set on the server, WS is disabled and clients should fall back to polling (usePollingContext
).connectionParams
(not standard headers).