Skip to main content
LIVON Logo

The real-time runtime with API sync for full-stack systems.

  • Realtime API interfaces that stay in sync.
  • Type-safe, validated payloads across frontend and backend.
  • Generated client APIs with JSDoc and sync workflow.

Server

import { createServer } from 'node:http';
import { WebSocketServer } from 'ws';
import { runtime } from '@livon/runtime';
import { schemaModule } from '@livon/schema';
import { nodeWsTransport } from '@livon/node-ws-transport';
import { serverSchema } from './schema.js';

const httpServer = createServer();
const wsServer = new WebSocketServer({ server: httpServer, path: '/ws' });

runtime(
nodeWsTransport({ server: wsServer }),
schemaModule(serverSchema, { explain: true }),
);

httpServer.listen(3002, '127.0.0.1');

Client Sync (Required)

livon --endpoint ws://127.0.0.1:3002/ws --out src/generated/api.ts --poll 2000 -- pnpm dev

Browser

import { runtime } from '@livon/runtime';
import { clientWsTransport } from '@livon/client-ws-transport';
import { api } from './generated/api.js';

runtime(clientWsTransport({ url: 'ws://127.0.0.1:3002/ws' }), api);

api({
onMessage: (payload) => {
console.log(payload.text);
},
});

await api.sendMessage({
author: 'Alice',
text: 'Hello from LIVON',
});

API Schema

import {
and,
api,
object,
operation,
string,
subscription,
} from '@livon/schema';

const MessageInput = object({
name: 'MessageInput',
shape: {
author: string(),
text: string(),
},
});

const WithId = object({ name: 'WithId', shape: { id: string() } });

const MessageWithId = and({ left: MessageInput, right: WithId });

const sendMessage = operation({
input: MessageInput,
output: MessageWithId,
exec: async (input) => ({ ...input, id: 'msg-1' }),
publish: {
onMessage: (output) => output,
},
});

export const ApiSchema = api({
operations: {sendMessage},
subscriptions: {onMessage: subscription({payload: MessageWithId})},
});

export const serverSchema = ApiSchema;

Quick Start

Start with the concept, run the sync, and ship your first realtime API sync flow fast.

Core Concepts

Why teams adopt LIVON and how one schema model reduces integration friction.

Open Core Concepts

Technical Docs

Deep dive into runtime flow, transport integration, and internals.

Open Technical Docs

Package Docs

Use each `@livon/*` package directly with practical API references and examples.

Go to Package Docs

Package Guide

Every package has a dedicated doc page with install commands, runtime wiring, and usage examples.

@livon/runtime

Event envelope lifecycle, room scoping, hooks, and module composition.

Read documentation

@livon/schema

Schema-first APIs for operations, subscriptions, parsing, and AST.

Read documentation

Transports + Tooling

Node/client websocket transports, DLQ module, config package, and CLI.

Read documentation