RealtimeCursor SDK

A powerful real-time collaboration SDK with live cursor tracking

Live Demo

Open this page in multiple browser windows to see the real-time collaboration in action.

Disconnected

Installation

npm

npm install realtimecursor-sdk

CDN

<script src="https://cdn.jsdelivr.net/npm/realtimecursor-sdk@1.1.0/dist-cdn/realtimecursor.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/realtimecursor-sdk@1.1.0/dist-cdn/realtimecursor.min.css">

Usage

// Initialize the cursor client
const cursorClient = new RealtimeCursor({
  apiUrl: 'https://your-api-url.com',
  projectId: 'your-project-id',
  user: {
    id: 'user-123',
    name: 'John Doe'
  }
});

// Connect to the real-time service
cursorClient.connect();

// Update cursor position on mouse move
editor.addEventListener('mousemove', (e) => {
  cursorClient.updateCursor({
    x: e.clientX,
    y: e.clientY
  });
});

// Update content on change
editor.addEventListener('input', (e) => {
  cursorClient.updateContent(e.target.value);
});

Features

Real-time Cursor Tracking

See other users' cursors in real-time as they move around the document.

Collaborative Editing

Edit documents together with multiple users simultaneously.

User Presence

See who's currently viewing and editing the document.

Typing Indicators

Know when other users are typing with real-time indicators.