CreateStoreOptions
Defined in: packages/@livestore/livestore/src/store/create-store.ts:116
Type Parameters
Section titled “Type Parameters”TSchema
Section titled “TSchema”TSchema extends LiveStoreSchema
TContext
Section titled “TContext”TContext = { }
TSyncPayloadSchema
Section titled “TSyncPayloadSchema”TSyncPayloadSchema extends Schema.Schema<any> = typeof Schema.JsonValue
Properties
Section titled “Properties”adapter
Section titled “adapter”adapter:
Adapter
Defined in: packages/@livestore/livestore/src/store/create-store.ts:122
batchUpdates()?
Section titled “batchUpdates()?”
optionalbatchUpdates: (run) =>void
Defined in: packages/@livestore/livestore/src/store/create-store.ts:132
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”void
boot()?
Section titled “boot()?”
optionalboot: (store,ctx) =>SyncOrPromiseOrEffect<void,unknown,LiveStoreContextRunning|OtelTracer>
Defined in: packages/@livestore/livestore/src/store/create-store.ts:125
Parameters
Section titled “Parameters”Store<TSchema, TContext>
migrationsReport
Section titled “migrationsReport”{ migrations: readonly object[]; }
migrationsReport.migrations
Section titled “migrationsReport.migrations”readonly object[]
parentSpan
Section titled “parentSpan”Span
Returns
Section titled “Returns”SyncOrPromiseOrEffect<void, unknown, LiveStoreContextRunning | OtelTracer>
confirmUnsavedChanges?
Section titled “confirmUnsavedChanges?”
optionalconfirmUnsavedChanges:boolean
Defined in: packages/@livestore/livestore/src/store/create-store.ts:147
Currently only used in the web adapter: If true, registers a beforeunload event listener to confirm unsaved changes.
Default
Section titled “Default”truecontext?
Section titled “context?”
optionalcontext:TContext
Defined in: packages/@livestore/livestore/src/store/create-store.ts:124
debug?
Section titled “debug?”
optionaldebug:object
Defined in: packages/@livestore/livestore/src/store/create-store.ts:172
instanceId?
Section titled “instanceId?”
optionalinstanceId:string
disableDevtools?
Section titled “disableDevtools?”
optionaldisableDevtools:boolean|"auto"
Defined in: packages/@livestore/livestore/src/store/create-store.ts:138
Whether to disable devtools.
Default
Section titled “Default”'auto'onBootStatus()?
Section titled “onBootStatus()?”
optionalonBootStatus: (status) =>void
Defined in: packages/@livestore/livestore/src/store/create-store.ts:139
Parameters
Section titled “Parameters”status
Section titled “status”{ stage: "loading"; } | { progress: { done: number; total: number; }; stage: "migrating"; } | { progress: { done: number; total: number; }; stage: "rehydrating"; } | { progress: { done: number; total: number; }; stage: "syncing"; } | { stage: "done"; }
Returns
Section titled “Returns”void
params?
Section titled “params?”
optionalparams:object
Defined in: packages/@livestore/livestore/src/store/create-store.ts:166
leaderPushBatchSize?
Section titled “leaderPushBatchSize?”
optionalleaderPushBatchSize:number
simulation?
Section titled “simulation?”
optionalsimulation:object
simulation.clientSessionSyncProcessor
Section titled “simulation.clientSessionSyncProcessor”clientSessionSyncProcessor:
object
simulation.clientSessionSyncProcessor.pull
Section titled “simulation.clientSessionSyncProcessor.pull”
readonlypull:object
simulation.clientSessionSyncProcessor.pull.1_before_leader_push_fiber_interrupt
Section titled “simulation.clientSessionSyncProcessor.pull.1_before_leader_push_fiber_interrupt”
readonly1_before_leader_push_fiber_interrupt:number
simulation.clientSessionSyncProcessor.pull.2_before_leader_push_queue_clear
Section titled “simulation.clientSessionSyncProcessor.pull.2_before_leader_push_queue_clear”
readonly2_before_leader_push_queue_clear:number
simulation.clientSessionSyncProcessor.pull.3_before_rebase_rollback
Section titled “simulation.clientSessionSyncProcessor.pull.3_before_rebase_rollback”
readonly3_before_rebase_rollback:number
simulation.clientSessionSyncProcessor.pull.4_before_leader_push_queue_offer
Section titled “simulation.clientSessionSyncProcessor.pull.4_before_leader_push_queue_offer”
readonly4_before_leader_push_queue_offer:number
simulation.clientSessionSyncProcessor.pull.5_before_leader_push_fiber_run
Section titled “simulation.clientSessionSyncProcessor.pull.5_before_leader_push_fiber_run”
readonly5_before_leader_push_fiber_run:number
schema
Section titled “schema”schema:
TSchema
Defined in: packages/@livestore/livestore/src/store/create-store.ts:121
shutdownDeferred?
Section titled “shutdownDeferred?”
optionalshutdownDeferred:ShutdownDeferred
Defined in: packages/@livestore/livestore/src/store/create-store.ts:140
storeId
Section titled “storeId”storeId:
string
Defined in: packages/@livestore/livestore/src/store/create-store.ts:123
syncPayload?
Section titled “syncPayload?”
optionalsyncPayload:Type<TSyncPayloadSchema>
Defined in: packages/@livestore/livestore/src/store/create-store.ts:165
Payload that is sent to the sync backend during connection establishment.
- Its TypeScript type is inferred from
syncPayloadSchema(i.e.typeof SyncPayload.Type). - At runtime this value is encoded with
syncPayloadSchemaand carried through the adapter to the backend where it can be decoded with the same schema.
Default
Section titled “Default”undefinedsyncPayloadSchema?
Section titled “syncPayloadSchema?”
optionalsyncPayloadSchema:TSyncPayloadSchema
Defined in: packages/@livestore/livestore/src/store/create-store.ts:155
Schema describing the shape of the sync payload and used to encode it.
- If omitted,
Schema.JsonValueis used (no additional typing/validation). - Prefer exporting a schema from your app (e.g.
export const SyncPayload = Schema.Struct({ authToken: Schema.String })) and pass it here to get end-to-end type safety and validation.