Collaborative Text Editor Sync

Real-time collaborative text editor synchronization for ProseMirror-based editors like Tiptap and BlockNote using Convex backend.

Installation

npm install @convex-dev/prosemirror-sync

About Collaborative Text Editor Sync

This is a Convex Component that syncs a ProseMirror document between clients via a Tiptap extension (that also works with BlockNote).

Add a collaborative editor that syncs to the cloud. With this component, users can edit the same document in multiple tabs or devices, and the changes will be synced to the cloud. The data lives in your Convex database, and can be stored alongside the rest of your app's data.

Just configure your editor features, add this component to your Convex backend, and use the provided sync React hook. Read this [Stack post](https://stack.convex.dev/add-a-collaborative-document-editor-to-your-app) for more details.

Benefits

Use cases

how to add real-time collaboration to Tiptap editor

The Collaborative Text Editor Sync component provides a drop-in sync engine for Tiptap editors. It handles operational transforms and conflict resolution automatically, letting multiple users edit the same document simultaneously with real-time updates.

ProseMirror collaborative editing with Convex

This component bridges ProseMirror editors with Convex's real-time database for collaborative editing. It manages document state synchronization and provides APIs to handle user cursors, selections, and concurrent edits without manual conflict resolution.

BlockNote real-time collaboration setup

The sync engine works with BlockNote editors to enable real-time collaborative editing. It automatically syncs document changes across users and handles the complex operational transform logic required for conflict-free collaborative text editing.

Frequently asked questions

Does this work with existing ProseMirror plugins?

Yes, the Collaborative Text Editor Sync component is designed to work alongside existing ProseMirror plugins. It operates at the document state level and doesn't interfere with other editor functionality like formatting, shortcuts, or custom plugins.

How does conflict resolution work when multiple users edit simultaneously?

The component implements operational transforms to handle concurrent edits automatically. When users make simultaneous changes, it applies transformation algorithms to merge changes without conflicts, ensuring all users see a consistent document state.

Can I customize the synchronization behavior?

The Collaborative Text Editor Sync component provides configuration options for sync frequency, conflict resolution strategies, and user presence indicators. You can customize how changes are batched and synchronized while maintaining the underlying collaborative editing guarantees.

What's the performance impact of real-time synchronization?

The component optimizes performance by batching changes, debouncing rapid edits, and only syncing incremental document changes rather than full document state. This minimizes network traffic and maintains responsive editing even with many concurrent users.

Links