Skip to main content
This guide shows you how to build a Google Docs-style collaborative text editor using CollabKit’s Yjs provider with TipTap.

What You’ll Build

  • A rich text editor where multiple users can type simultaneously
  • Conflict-free collaborative editing via CRDTs
  • Persistent document state (survives page refreshes)
  • User cursors and presence indicators

Prerequisites

  • A CollabKit server running with a room and users created
  • @collab-kit/client installed

Step 1: Install Dependencies

Step 2: Set Up CollabKit

Yjs writes require an editor session. A viewer can load and receive document updates, but outbound Yjs changes are blocked.

Step 3: Create the Yjs Document and Provider

Step 4: Initialize TipTap

Always disable TipTap’s built-in history extension when using Collaboration. Yjs provides its own undo/redo management that understands collaborative edits.

Step 5: Add a Loading State

Show a loading indicator until the document syncs:

Step 6: Add User Presence (Optional)

Show cursor positions of other users alongside the editor:

Step 7: Clean Up

Multiple Documents Per Room

You can have multiple collaborative documents in the same room by using different documentId values:

Next Steps