forrealtime

React Client

RealtimeProvider, createRealtime, and useRealtime hook for typed real-time subscriptions.

The React client has two steps:

  1. Wrap your app (or a subtree) in RealtimeProvider
  2. Create a typed useRealtime() hook with createRealtime<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