Skip to content

API overview

The API reference lists the public APIs for @lsync/definitions, @lsync/server, @lsync/client, and @lsync/transport.

Common entry points

APIPackagePurpose
defineCollections()@lsync/definitionsDefine shared schemas, keys, child collections, and API contracts.
CollectionShardDurableObject.from()@lsync/serverAdd indexes, initial data, access rules, references, and handlers.
CollectionShardDurableObject@lsync/serverHost storage, reads, history, subscriptions, and APIs in a DO.
createWorkerHandler()@lsync/serverRoute /sync/:shardId WebSocket requests to the Durable Object.
collectionTypesFrom()@lsync/clientBuild typed client managers from the shared definition.
eq, and, or, inArray@lsync/serverBuild serializable read and access expressions.

Public API boundaries

Use @lsync/definitions in shared contract modules, @lsync/server in Worker and Durable Object code, and @lsync/client in application code. Use @lsync/transport for custom transport integrations.