Socket.IO connector for Yjs, inspired by y-websocket. Current stable version is 1.1.3. It provides a server and client implementation for synchronizing Yjs documents over Socket.IO, with features such as authentication, LevelDB persistence, custom callbacks, and cross-tab communication. It is a lightweight alternative to y-websocket for developers already using Socket.IO, offering easy integration and configuration.
npm install y-socket.ioNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up a basic y-socket.io server and client with Socket.IO and Yjs.
Avoid using namespaces that match the regular expression /^\/yjs\|.*$/ in your application.
Call ysocketio.initialize() after creating the YSocketIO instance.
Pass persistence options to YSocketIO constructor, e.g., new YSocketIO(io, { persistence: { levelPersistenceDir: './db' } }).Use import { YSocketIO } from 'y-socket.io/dist/server' (or require('y-socket.io/dist/server')).Ensure you pass a Yjs document: new SocketIOProvider(url, room, doc).
Do not use namespaces starting with '/yjs|' for other purposes in your Socket.IO server.