@remotedraw/protocol
v0.5.0
Published
Shared RemoteDraw protocol schemas, types, and constants for sessions, senders, and strokes.
Maintainers
Readme
@remotedraw/protocol
Shared TypeScript types, Zod schemas, and constants for the
RemoteDraw session/sender/stroke protocol. Framework-free and dependency-free
beyond zod — this is the contract layer every other RemoteDraw package
(@remotedraw/client, @remotedraw/react, @remotedraw/svelte) and the
hosted API agree on.
What it provides:
- Request/response types for sessions, join tokens, senders, drawings, drafts,
projections, and AI actions (
CreateSessionRequest,JoinSessionResponse,SenderSubmitRequest, and friends). - The value unions behind those types (
sessionStatusValues,surfaceKindValues,drawingToolValues,aiActionKindValues, etc.) so clients can validate without re-declaring the protocol. REMOTEDRAW_LIMITSandDEFAULT_CAPABILITIES— the numeric limits and default capability set the hosted API enforces.packPoints/unpackPoints— the compact point codec used to transport strokes over the wire.
import type { CreateSessionRequest, CreateSessionResponse } from "@remotedraw/protocol";
const request: CreateSessionRequest = {
target: { kind: "sketch" },
};Most integrations consume this indirectly through @remotedraw/client,
@remotedraw/react, or @remotedraw/svelte, which re-export it in full.
Depend on it directly only for a package-free, type-only integration (the
--sdk js RemoteDraw CLI starter).
