Svelte Client
provideRealtime, createRealtime, and useRealtime for typed real-time subscriptions in Svelte.
The Svelte client has two steps:
- Call
provideRealtime()in a parent component - Create a typed
useRealtime()helper withcreateRealtime<typeof realtime>()
import { provideRealtime, createRealtime } from "forrealtime/client/svelte";- provideRealtime — Create a shared realtime client for a component subtree
- useRealtime — Subscribe to channels and receive typed events
- Type Inference — Infer event types directly from your server schema