explaingit

yankeeinlondon/y-websocket

Analysis updated 2026-07-12 · repo last pushed 2021-12-30

Audience · developerComplexity · 3/5DormantSetup · moderate

TLDR

A connector that lets multiple people work on the same document at the same time by syncing changes through a central server. Built for Yjs, it powers real-time collaboration in web apps.

Mindmap

mindmap
  root((repo))
    What it does
      Syncs changes instantly
      Shares cursor positions
      Syncs across browser tabs
    Tech stack
      WebSocket
      Yjs
      JavaScript
      Node.js
    Use cases
      Collaborative text editors
      Shared whiteboards
      Multi-user boards
    Audience
      App developers
      Builder teams
    Architecture
      Central server model
      HTTP callback for saving
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Google Docs-style collaborative text editor where teammates edit the same document simultaneously.

USE CASE 2

Add real-time cursor presence to a shared whiteboard or canvas application.

USE CASE 3

Sync document state across multiple browser tabs without hitting the server.

USE CASE 4

Trigger server-side saves or notifications when a shared document changes using HTTP callback mode.

What is it built with?

JavaScriptYjsWebSocketNode.js

How does it compare?

yankeeinlondon/y-websocket0xhassaan/nn-from-scratch0xzgbot/hermes-comfyui-skills
Stars00
LanguagePython
Last pushed2021-12-30
MaintenanceDormant
Setup difficultymoderatemoderateeasy
Complexity3/54/51/5
Audiencedeveloperdeveloperdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires running a WebSocket server alongside your application and wiring up Yjs document instances on the client.

The license is not specified in the explanation, so it is unknown what permissions are granted.

In plain English

y-websocket is a connector that lets multiple people work on the same document at the same time through a central server. It is built for Yjs, a library that handles real-time collaboration in web applications. The user-facing benefit is straightforward: when someone types, moves a cursor, or makes changes, everyone else viewing the same document sees it instantly. The project uses a classic client-server setup. Each person's browser connects to a single server using a persistent connection called a WebSocket. When someone makes a change, their browser sends it to the server, and the server forwards that update to everyone else connected to the same "room." The server also tracks awareness information, which is how it shares things like cursor positions so you can see where other people are working. If you open the same document in multiple tabs in the same browser, it syncs between tabs directly without even needing to talk to the server. This would be used by developers building collaborative editing tools, think Google Docs-style text editors, shared whiteboards, or multi-user project management boards. For example, if you are building a note-taking app and want multiple teammates to edit the same document simultaneously, this handles the plumbing of moving changes between everyone's browsers. It also supports an HTTP callback mode, which lets your server save document updates to a database or trigger other actions whenever the document changes. One notable tradeoff is that it relies on a central server rather than a peer-to-peer approach. The upside is that you can handle authentication and authorization through standard mechanisms like cookies and headers, since every connection passes through your server. The server included here is described as a basic starting point, so you would likely adapt it to fit your specific needs around user permissions, data storage, and scaling.

Copy-paste prompts

Prompt 1
Set up a basic Yjs document with y-websocket so that two browser tabs editing the same text stay in sync in real time. Include the server and client code.
Prompt 2
Add awareness state to my y-websocket setup so that each connected user's cursor position is visible to everyone else in the same room.
Prompt 3
Implement HTTP callback mode in y-websocket so that every document update is persisted to a simple database, and show how to verify the callback is firing.
Prompt 4
Extend the basic y-websocket server to require a cookie-based authentication check before allowing a client to join a room and receive updates.

Frequently asked questions

What is y-websocket?

A connector that lets multiple people work on the same document at the same time by syncing changes through a central server. Built for Yjs, it powers real-time collaboration in web apps.

Is y-websocket actively maintained?

Dormant — no commits in 2+ years (last push 2021-12-30).

What license does y-websocket use?

The license is not specified in the explanation, so it is unknown what permissions are granted.

How hard is y-websocket to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is y-websocket for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.