MakeWorkerOptions
MakeWorkerOptions<
TEnv,TSyncPayload> =object
Defined in: packages/@livestore/sync-cf/src/cf-worker/worker.ts:25
Options accepted by makeWorker. The Durable Object binding has to be supplied explicitly so we never fall back to deprecated defaults when Cloudflare config changes.
Type Parameters
Section titled “Type Parameters”TSyncPayload
Section titled “TSyncPayload”TSyncPayload = Schema.JsonValue
Properties
Section titled “Properties”enableCORS?
Section titled “enableCORS?”
optionalenableCORS:boolean
Defined in: packages/@livestore/sync-cf/src/cf-worker/worker.ts:46
Default
Section titled “Default”falsesyncBackendBinding
Section titled “syncBackendBinding”syncBackendBinding:
HelperTypes.ExtractDurableObjectKeys<TEnv>
Defined in: packages/@livestore/sync-cf/src/cf-worker/worker.ts:29
Binding name of the sync Durable Object declared in wrangler config.
syncPayloadSchema?
Section titled “syncPayloadSchema?”
optionalsyncPayloadSchema:Schema.Schema<TSyncPayload>
Defined in: packages/@livestore/sync-cf/src/cf-worker/worker.ts:39
Optionally pass a schema to decode the client-provided payload into a typed object before calling validatePayload. If omitted, the raw JSON value is forwarded.
validatePayload()?
Section titled “validatePayload()?”
optionalvalidatePayload: (payload,context) =>void|Promise<void>
Defined in: packages/@livestore/sync-cf/src/cf-worker/worker.ts:44
Validates the (optionally decoded) payload during WebSocket connection establishment.
If syncPayloadSchema is provided, payload will be of the schema’s inferred type.
Parameters
Section titled “Parameters”payload
Section titled “payload”TSyncPayload
context
Section titled “context”storeId
Section titled “storeId”string
Returns
Section titled “Returns”void | Promise<void>
