Skip to content

makeWorker

makeWorker<TEnv, TDurableObjectRpc, TSyncPayload>(options): CFWorker<TEnv, TDurableObjectRpc>

Defined in: packages/@livestore/sync-cf/src/cf-worker/worker.ts:56

Produces a Cloudflare Worker fetch handler that delegates sync traffic to the Durable Object identified by syncBackendBinding.

For more complex setups prefer implementing a custom fetch and call handleSyncRequest from the branch that handles LiveStore sync requests.

TEnv extends Env = Env

TDurableObjectRpc extends undefined | DurableObjectBranded = undefined

TSyncPayload = JsonValue

MakeWorkerOptions<TEnv, TSyncPayload>

CFWorker<TEnv, TDurableObjectRpc>