WebSocket client and minimal SimpleServer for syncing Loro CRDTs. Version 0.6.2, actively maintained, with peer dependency on loro-crdt ^1.9.0. Features: auto-reconnect with exponential backoff, latency tracking via ping/pong, safe fragmentation/reassembly for large updates, seamless room rejoin across reconnects, E2EE support via EloAdaptor. Differentiator: tightly integrated with Loro CRDT ecosystem, provides a simple server for prototyping, and offers both plain and encrypted adaptors.
npm install loro-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to a WebSocket server, joins a room, modifies a CRDT document, and cleans up.
Assign (globalThis as any).WebSocket = require('ws') (or import { WebSocket } from 'ws') before any loro-websocket import.Use ClientStatus.Connecting, ClientStatus.Connected, ClientStatus.Disconnected as string literals.
Install loro-adaptors and import adaptors from 'loro-adaptors/loro' instead of 'loro-websocket'.
Use import { LoroWebsocketClient } from 'loro-websocket'Install ws and set (globalThis as any).WebSocket = require('ws') before importing loro-websocket.Run: pnpm add loro-adaptors