MakeDurableObjectClassOptions
MakeDurableObjectClassOptions =
object
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:12
Properties
Section titled “Properties”enabledTransports?
Section titled “enabledTransports?”
optionalenabledTransports:Set<"http"|"ws"|"do-rpc">
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:45
Enabled transports for sync backend
- http: HTTP JSON-RPC
- ws: WebSocket
- do-rpc: Durable Object RPC calls (only works in combination with- @livestore/adapter-cf)
Default
Section titled “Default”Set(['http', 'ws', 'do-rpc'])
optionalhttp:object
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:63
Custom HTTP response headers for HTTP transport These headers will be added to all HTTP RPC responses (Pull, Push, Ping)
responseHeaders?
Section titled “responseHeaders?”
optionalresponseHeaders:Record<string,string>
Example
Section titled “Example”{  http: {    responseHeaders: {      'Access-Control-Allow-Origin': '*',      'Cache-Control': 'no-cache'    }  }}onPull()?
Section titled “onPull()?”
optionalonPull: (message,context) =>Effect.SyncOrPromiseOrEffect<void>
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:18
Parameters
Section titled “Parameters”message
Section titled “message”SyncMessage.PullRequest
context
Section titled “context”payload?
Section titled “payload?”Schema.JsonValue
storeId
Section titled “storeId”Returns
Section titled “Returns”Effect.SyncOrPromiseOrEffect<void>
onPullRes()?
Section titled “onPullRes()?”
optionalonPullRes: (message) =>Effect.SyncOrPromiseOrEffect<void>
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:22
Parameters
Section titled “Parameters”message
Section titled “message”SyncMessage.PullResponse | InvalidPullError
Returns
Section titled “Returns”Effect.SyncOrPromiseOrEffect<void>
onPush()?
Section titled “onPush()?”
optionalonPush: (message,context) =>Effect.SyncOrPromiseOrEffect<void>
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:13
Parameters
Section titled “Parameters”message
Section titled “message”SyncMessage.PushRequest
context
Section titled “context”payload?
Section titled “payload?”Schema.JsonValue
storeId
Section titled “storeId”Returns
Section titled “Returns”Effect.SyncOrPromiseOrEffect<void>
onPushRes()?
Section titled “onPushRes()?”
optionalonPushRes: (message) =>Effect.SyncOrPromiseOrEffect<void>
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:17
Parameters
Section titled “Parameters”message
Section titled “message”SyncMessage.PushAck | InvalidPushError
Returns
Section titled “Returns”Effect.SyncOrPromiseOrEffect<void>
optionalotel:object
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:67
baseUrl?
Section titled “baseUrl?”
optionalbaseUrl:string
serviceName?
Section titled “serviceName?”
optionalserviceName:string
storage?
Section titled “storage?”
optionalstorage: {_tag:"do-sqlite"; } | {_tag:"d1";binding:string; }
Defined in: packages/@livestore/sync-cf/src/cf-worker/shared.ts:35
Storage engine for event persistence.
- Default: { _tag: 'do-sqlite' }(Durable Object SQLite)
- D1: { _tag: 'd1', binding: string }wherebindingis the D1 binding name in wrangler.toml.
If omitted, the runtime defaults to DO SQLite. For backwards-compatibility, if an env binding named
DB exists and looks like a D1Database, D1 will be used.
Trade-offs:
- DO SQLite: simpler deploy, data co-located with DO, not externally queryable
- D1: centralized DB, inspectable with DB tools, extra network hop and JSON size limits
