yjs-getting-started

Configure HTTP-based Yjs document synchronization over Durable Streams.

1.7k|64|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/durable-streams/durable-streams --skill yjs-getting-started
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yjs-getting-started
Source: https://github.com/durable-streams/durable-streams/tree/main/packages/y-durable-streams/skills/yjs-getting-started
Command: npx skills add https://github.com/durable-streams/durable-streams --skill yjs-getting-started

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide removes friction when configuring Yjs to sync over Durable Streams by walking through peer dependency installation, running the required local servers, creating a collaborative Y.Doc, and verifying presence and synchronization so edits reliably replicate across clients.

Core Features & Use Cases

  • HTTP-based Yjs syncing: Use standard HTTP with SSE or long-polling to sync Yjs documents without WebSocket infrastructure.
  • Developer-focused dev server setup: Start a DurableStreamTestServer and a YjsServer that proxies storage operations for local development and testing.
  • Presence and awareness: Integrate y-protocols/awareness to track remote users and share presence metadata such as cursor position or user info.
  • Use Case: Rapidly prototype collaborative editors (rich text or code) that resume across reconnections and provide replayable change history.

Quick Start

Start a DurableStreamTestServer and a YjsServer locally, create a Y.Doc, instantiate a YjsProvider with baseUrl set to your service root and docId set to your document, and confirm the provider emits a synced event.

Frequently Asked Questions about yjs-getting-started

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync Yjs documents over HTTP without using WebSocket infrastructure?

To set up Yjs collaborative editing locally, install peer dependencies, start a DurableStreamTestServer and a YjsServer, instantiate a YjsProvider with the correct baseUrl, and confirm the provider emits a synced event.

Can I track remote user presence and cursor positions in a Yjs collaborative editor?

Yes, you can integrate y-protocols/awareness to track remote users and share presence metadata such as cursor positions. This allows your collaborative editing clients to maintain real-time awareness of other users editing the same document.

Does Yjs provider require a specific baseUrl configuration to sync documents correctly?

No, this setup uses HTTP-based syncing via Durable Streams, so you do not need WebSocket infrastructure. You only need to run a DurableStreamTestServer and a YjsServer locally to proxy storage operations for development.

Why is my YjsProvider not emitting a synced event during local development?

You can track remote user presence in a Yjs collaborative editor by integrating y-protocols/awareness. This shares presence metadata such as cursor position and user info across connected clients.