Skip to content

gitflarePublicPartly agent-ready50

cf-durable-whiteboard

Realtime collaborative whiteboard on Cloudflare Durable Objects: presence cursors, WebSocket hibernation, SQLite storage, undo, PNG export.

Keep board zoom and pan stable across reloads6eb4fbd
TypeScript10 lines387 B
export const ID_ALPHABET = "abcdefghjkmnpqrstuvwxyz23456789";export function randomId(len = 8, rnd: (n: number) => number = (n) => Math.floor(Math.random() * n)): string {  let s = "";  for (let i = 0; i < len; i++) s += ID_ALPHABET[rnd(ID_ALPHABET.length)];  return s;}export function isBoardId(id: string): boolean {  return /^[abcdefghjkmnpqrstuvwxyz23456789]{8}$/.test(id);}