forrealtime

Svelte Client

provideRealtime, createRealtime, and useRealtime for typed real-time subscriptions in Svelte.

The Svelte client has two steps:

  1. Call provideRealtime() in a parent component
  2. Create a typed useRealtime() helper with createRealtime<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