realtimecursor
Version:
Real-time collaboration system with cursor tracking and approval workflow
34 lines (28 loc) • 765 B
JavaScript
const { RealtimeCursor } = require('realtimecursor-sdk-fixed');
// Create a test client
const client = new RealtimeCursor({
apiUrl: 'http://localhost:3001',
projectId: 'test-project',
user: {
id: 'test-user',
name: 'Test User',
color: '#3b82f6'
}
});
// Set up event handlers
client.onCollaboratorsChange = (collaborators) => {
console.log('Collaborators changed:', collaborators);
};
client.onCursorUpdate = (data) => {
console.log('Cursor update:', data);
};
client.onContentUpdate = (data) => {
console.log('Content update:', data);
};
// Connect to the server
console.log('Connecting to server...');
client.connect();
// Keep the process running
setInterval(() => {
console.log('Client connected:', client.connected);
}, 5000);