API reference
datadata is imported by subpath: each @repo/datadata/<name> holds one part of the API. An application defines its documents with schema and connects withclient; a backend runs server on a storage adapter.
@repo/datadata/authzDeclarative authorization: evaluating a schema's access rules for a principal, the role vocabulary, and the scope checks behind every read and write decision.
@repo/datadata/clientCreating a datadata client, the connection to a server that reads, subscribes to and optimistically writes documents.
@repo/datadata/commandsDomain commands: the app's named, typed mutators (
defineCommands) that the client runs for its optimistic view and the server runs authoritatively, each granted as an authorization kind of its own.@repo/datadata/documentThe document model every other subpath builds on: the document handle, write results, and the errors reads and writes reject with.
@repo/datadata/eventsThe wire protocol between client and server: the event types, their parsers, and the transport constants.
@repo/datadata/in-memoryThe whole engine in one process: an in-memory client and storage for demos, tests and prototypes that need no server.
@repo/datadata/in-processConnecting a real client to a server in the same process without a socket, for example inside a Durable Object.
@repo/datadata/loggerThe logger interface datadata reports through, and a console logger for the browser.
@repo/datadata/persistenceOffline persistence for the client: the adapter interface for caching documents and pending writes, and an in-memory implementation.
@repo/datadata/persistence-idbThe IndexedDB persistence adapter, for offline support in the browser.
@repo/datadata/projectionProjections: declarative read models over a document's records (filter, sort, group, resolve), and which projected fields can be written back.
@repo/datadata/schemaDefining document schemas: field types, access rules, and the registry that clients and servers validate documents against.
@repo/datadata/serverRunning a datadata server: the engine that validates, authorizes, stores and broadcasts document changes, and the storage adapter interface it runs on.
@repo/datadata/sessionSessions over documents: the live session, and staging sessions that collect changes as a changeset before they reach the documents.
@repo/datadata/systemThe system documents an application reads directly: access and identity, sync status, the document index and trash, schema documents and presence channels.
@repo/datadata/testTest helpers: a mock live client, a recording logger, and a collector for write errors.
@repo/datadata/utilsUtilities shared across datadata and its consumers: JSON Patch application, prototype-safe own-key access, and fractional indexing for ordered lists.
@repo/datadata/yjsYjs integration: awareness (cursors and selections) bridged into datadata presence.