React Client
RealtimeProvider, createRealtime, and useRealtime hook for typed real-time subscriptions.
The React client has two steps:
- Wrap your app (or a subtree) in
RealtimeProvider - Create a typed
useRealtime()hook withcreateRealtime<typeof realtime>()
import { RealtimeProvider, createRealtime } from "forrealtime/client";- RealtimeProvider — Opens a shared EventSource connection for your component tree
- useRealtime — Subscribe to channels and receive typed events
- Type Inference — Infer event types directly from your server schema