Skip to content

MakeWorkerOptions

MakeWorkerOptions<TEnv> = object

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

TEnv extends Env = Env

optional durableObject: object

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

optional name: ExtractDurableObjectKeys<TEnv>

Needs to match the binding name from the wrangler config

'WEBSOCKET_SERVER'

optional enableCORS: boolean

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

false

optional validatePayload: (payload, context) => void | Promise<void>

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

Validates the payload during WebSocket connection establishment. Note: This runs only at connection time, not for individual push events. For push event validation, use the onPush callback in the durable object.

Schema.JsonValue | undefined

string

void | Promise<void>