Realtime collaboration
Let several people edit one document at the same time, with live changes and automatic saves to a file.
Deploys on
- Node
- Docker
- Cloudflare
server/realtime/docs.tsSame on every host
import { defineRealtime } from 'vite-hub/realtime'
// This file defines the docs room.
export default defineRealtime({
// Only signed-in users can read and edit
authorize: true,
// Save each document to the docs Workspace
document: { workspace: 'docs' },
// Let the editor save a version on request
history: {
checkpoint: { message: 'Save document' },
},
})Deploy on
Node / Docker: Postgres or Redis
Works with your TipTap editor
useRealtimeTiptap() gives your TipTap editor live sync and its connection state.Presence parts in @vite-hub/ui
Pass
people, status, and save state straight into the avatar stack and status UI parts.Decide who can join
authorize: true allows only signed-in people. authorize() decides who reads or edits each document.