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.
Requirements
svelte-realtime runs on any environment that supports long-lived Node.js processes - VPS, containers, Docker, bare metal. It uses uWebSockets.js for native WebSocket performance, which means it needs a persistent server process. It does not run on serverless platforms (Vercel, Cloudflare Workers, Netlify Functions) or edge runtimes. This is a deliberate architectural choice, not a limitation - native WebSocket connections require a long-lived process.
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 - 24 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?