Canvas & drafts
Live collaborative documents inside conversations, and unsent text saved per chat.
Canvas (collaborative documents)
A Canvas is a rich-text document that belongs to a conversation and is edited live by its members. Built in, gated by the canvasEnabled setting.
- Open it from the header options menu → Canvas, or the canvas list in the header (
CanvasListPanel). - Create, rename and delete documents; edits sync in real time with live presence and a saving / saved status.
- Paste images and attach files inside a document - same upload rules and size limits as chat attachments.
CanvasOverlayis mounted automatically by the default layout.
Replace the list with the CanvasListPanel slot:
tsx
components={{ CanvasListPanel: (props) => <MyCanvasList {...props} />,}}Canvas exports
Drafts
Unsent text in the composer is saved per conversation (and per thread) on the server, so it survives a reload or another device. The conversation list shows a Draft preview for chats with unsent text. Gated by draftsEnabled; limits are maxDraftLength and maxDraftsPerUser. No setup needed. For custom UI:
typescript
import { loadDraftsFromServer, getConversationDraft, getConversationDraftPreview, clearConversationDraft,} from "@realtimexsco/live-chat"; const draft = getConversationDraft(conversationId); // ConversationDraft (empty if none)const preview = getConversationDraftPreview(conversationId); // short text for a list rowclearConversationDraft(conversationId);Also exported: getDraftByTarget, clearDraft, makeDraftKey and the types ConversationDraft, ServerDraft, DraftSavePayload, DraftTarget.