import { live } from 'svelte-realtime/server'
let count = 0
export const increment = live(ctx => {
count++
ctx.publish(
'counter', 'updated', count
)
})
export const counter =
live.stream('counter', () => count)<script>
import { increment, counter }
from '$live/counter'
</script>
<p>{$counter}</p>
<button onclick={increment}>
+1
</button>Counter
0
Live for ALL visitors
That click traveled through a WebSocket, updated server state, and reached every connected browser.
Interactive Tutorial
Learn by building
24 hands-on lessons. Write real code in a live editor. It runs on a real server, in a secure sandbox. Watch two users sync through your code in real time.
Start the TutorialWrite
src/live/*.js
live() and live.stream()
Import
$live/module
Virtual imports, auto-generated
Call
async fn()
Functions and Svelte stores
React
all clients
Everyone updates in real time
Remote Procedure Calls
RPC over WebSocket
Call server functions like local async functions. No REST endpoints, no serialization layer. Just call the function and get the result.
Learn more →Call a server function. See the round-trip time.
Live Data Everywhere
Reactive Streams
Svelte stores that sync automatically across every connected client. When data changes on the server, every browser updates instantly.
Learn more →Live poll - everyone sees the result
0 votes - updates live for everyone
Who's Here Right Now
Presence
Know who's connected, what page they're on, and where their cursor is. Build collaborative experiences with a single function call.
Learn more →Waiting for visitors...
0 people are on this page right now
Scheduled Server Tasks
Cron Jobs
Run server-side tasks on a schedule with live.cron(). Heartbeats, cleanup, polling, data sync - all built in.
Learn more →Waiting for first tick...
Server cron fires every 60s
Merge Strategies
crud, patch, signal - pick how data merges
Auth Built-in
Per-module and per-function authorization via upgrade()
Rooms
Bundle data, presence, cursors, and actions in one declaration
Webhooks
Bridge Stripe, GitHub, and any HTTP webhook into your streams
Optimistic Updates
Instant UI with automatic rollback on conflict
Offline Queue
Queue calls offline, replay automatically on reconnect
Schema Evolution
Version your stream data with automatic migrations
Derived Streams
Computed streams that react when source topics publish
Chat, dashboards, collaborative editing, multiplayer, notifications - anything that needs to stay in sync.
Performance
Typical round-trip cost per transport, not a library vs library benchmark.
WebSocket
svelte-realtime
GraphQL Sub
subscription
REST API
polling
0
concurrent users
0 FPS
sustained
0 KB
client bundle
Production Ready
Same API from single process to distributed cluster.
9 plugins built in
Drop-in scaling
Same plugin API. Swap the backing store. No rewrite.
Loading recent stars...
Built with svelte-realtime
svelte-realtime-demo
Collaborative sticky notes - real-time, multiplayer, persistent.
This docs site
You're looking at it. Presence, live counters, ghost cursors - all svelte-realtime.