Collaborative Editing
Enable multiple users to edit documents, whiteboards, spreadsheets, or any shared state simultaneously. Show live cursors, selections, and presence indicators so everyone knows who is working where.
Implementation
example.js
// The user's identity (user_id, user_info) comes from your auth endpoint's channel_data
const doc = client.connect().subscribe('presence-doc-abc')
// Show live collaborators
doc.bind('realtime:member_added', (member) => {
showAvatar(member.user_info.name, member.user_info.color)
})
// Broadcast cursor position (client event)
doc.trigger('client-cursor', { x: 420, y: 180, selection: [12, 47] })
// Render other users' cursors
doc.bind('client-cursor', (data) => moveCursor(data))Why Apinator for collaborative editing
Presence channels to track who is viewing or editing a document
Live cursor positions and selections via client events
Member join/leave events to update the collaborator list
No server roundtrip for cursor moves — direct peer-to-peer feel
Multi-tab tracking so users appear once even with multiple tabs
Scales to hundreds of concurrent editors per document
Other use cases
From the blog
How to Build a Live Collaborative Document Editor
Learn how to build a Google Docs-style collaborative editor with real-time cursor tracking, live edits, and presence indicators using WebSockets.
How the WebSocket Handshake Works
The WebSocket connection starts as HTTP and upgrades to a persistent socket. Here's exactly what happens during the handshake — headers, keys, and all.
Presence Channels Explained
Presence channels let you track who's online in real time — showing typing indicators, viewer counts, and live cursors without building your own member tracking.
Ready to build collaborative editing?
Get started in minutes. Completely free, no credit card required.