Quick Start
One command. Full project. Working realtime.
npx svelte-realtime my-app
cd my-app
npm run dev Open your browser. Click the button. Open a second tab. Click again. Both tabs update.
What just happened
The CLI scaffolded a SvelteKit project with everything wired:
svelte.config.js- adapter set tosvelte-adapter-uwsvite.config.js-sveltekit(),uws(), andrealtime()pluginssrc/hooks.ws.ts- WebSocket upgrade and message handlersrc/live/counter.ts- a workinglive()RPC +live.stream()src/routes/+page.svelte- imports from$live/counterand renders it
Templates
Three templates are available:
| Template | What you get |
|---|---|
minimal (default) | Just the wiring - SvelteKit + svelte-realtime, no example code |
example | Working counter - open two tabs, click, both update |
demo | Clones the full svelte-realtime-demo app |
npx svelte-realtime my-app --template minimal
npx svelte-realtime my-app --template demo Package manager detection
The CLI detects your preferred package manager. If you run it with pnpm dlx, it uses pnpm. Same for yarn and bun.
Next steps
- Tutorial - 12 interactive lessons, write real code in the browser
- Manual setup - add svelte-realtime to an existing project
- RPC - how
live()works - Streams - how
live.stream()works
Was this page helpful?