Presence in your app
Show who is in a file and where their cursor is.
import { useVarialFilePresence } from '@varial/presence'
const room = useVarialFilePresence({
identity: { app: 'design', fileId },
title: 'Launch page',
})
await room.start()
canvas.addEventListener('pointermove', (e) => {
room.updateCursor({ x: e.offsetX, y: e.offsetY })
})How it works
Durable room events go through the server. Cursor positions are whispered between people in the room, so they are never stored.
Was this helpful?