Skip to content

makeWorker

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

Defined in: worker.ts:73

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 any = undefined

TSyncPayload = Json

MakeWorkerOptions<TEnv, TSyncPayload>

CFWorker<TEnv, TDurableObjectRpc>