@ruvyxa/realtime
v1.1.5
Published
Native WebSocket realtime and collaboration rooms for self-hosted Ruvyxa applications.
Maintainers
Readme
// ruvyxa.config.ts
import { config } from 'ruvyxa/config'
export default config({ realtime: true })// app/todos/action.ts
import { action } from 'ruvyxa/server'
export const updateTodo = action
.realtime('todos')
.handler(async ({ input }) => db.todos.update(input))// browser code
import { createRealtimeClient } from '@ruvyxa/realtime/client'
const realtime = createRealtimeClient()
const unsubscribe = realtime.subscribe('todos', () => refetchTodos())Calling .realtime() without channels publishes to route:<pathname>. Events contain action name,
route, channel names, and cache invalidation keys—not action results, credentials, or database rows.
Long route names use the same deterministic route-hash:<id> mapping in the worker and browser.
Clients reconnect with bounded exponential backoff and receive a resync event if their server-side
broadcast queue lagged, allowing the application to refetch authoritative state.
Where it runs. The transport is served by the Axum host and nothing else. A deployment that
depends on it runs ruvyxa start as its process — on Railway, Render, a VM, a container. Every
adapter, including node, bun, deno, railway, and render, emits a build artifact that speaks plain
HTTP with no upgrade path, and ruvyxa build says so once with RUV2205, naming the config key and
the path that will answer 404 in that deployment. Horizontal multi-instance fan-out requires a
future external broker adapter and is not claimed by this release.
realtime serves the framework-owned socket at /__ruvyxa/realtime (path, heartbeatMs, and
capacity are its options); collab serves collaboration rooms at /__ruvyxa/collab under the
same rule. Both are keys of ruvyxa.config.ts, typed as RealtimeConfig and CollabConfig, which
this package re-exports.
