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 to svelte-adapter-uws
  • vite.config.js - sveltekit(), uws(), and realtime() plugins
  • src/hooks.ws.ts - WebSocket upgrade and message handler
  • src/live/counter.ts - a working live() RPC + live.stream()
  • src/routes/+page.svelte - imports from $live/counter and renders it

Templates

Three templates are available:

TemplateWhat you get
minimal (default)Just the wiring - SvelteKit + svelte-realtime, no example code
exampleWorking counter - open two tabs, click, both update
demoClones 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?