gitflarePublicPartly agent-ready50
cf-durable-whiteboard
Realtime collaborative whiteboard on Cloudflare Durable Objects: presence cursors, WebSocket hibernation, SQLite storage, undo, PNG export.
- LicenseApache-2.0
- LanguageTypeScript
- Last landed
6eb4fbdOct 20, 2026
Keep board zoom and pan stable across reloads
6eb4fbdWire protocol
WebSocket at GET /ws/<id> (id: 8 chars from abcdefghjkmnpqrstuvwxyz23456789). JSON text frames, max 32 KB.
Client → server
{type:"hello", name}set display name{type:"op", op}op isadd|update(shape),delete(id),clear, orbatch(ops){type:"undo"}/{type:"redo"}per-user, applied server-side as inverse ops{type:"cursor", x, y}relayed only, never stored (throttle to 20/s)
Shapes: {id, kind: pen|rect|ellipse|arrow|note, colour?: "#rrggbb", size?, z?} plus points (pen, even-length number array) , x,y,w,h (rect/ellipse/arrow) or x,y,text (note).
Server → client
welcome{you, shapes, peers, seq}op{seq, op, by}cursor{userId, x, y}peer-join{peer}/peer-leave{userId}error{message}
you/peer = {userId, name, colour}.
Limits
Token bucket 60 msg/s, burst 120 per socket; after 20 strikes the socket closes with 1008. Last 500 ops are retained.
HTTP
GET /api/boards/:id→{shapes, lastUpdate}GET /health→{ok:true}- Errors:
{error:{code,message}}