Skip to content

SyncStatus

SyncStatus = object

Defined in: packages/@livestore/livestore/src/store/store-types.ts:437

Represents the current synchronization status of the store.

This provides visibility into the sync state between the client session and the leader thread, allowing applications to show sync indicators or determine backend health.

const status = store.syncStatus()
if (status.isSynced) {
console.log('All changes synced')
} else {
console.log(`${status.pendingCount} events pending sync`)
}

isSynced: boolean

Defined in: packages/@livestore/livestore/src/store/store-types.ts:456

Whether the client session is fully synced with the leader thread. True when there are no pending events (pendingCount === 0).


localHead: string

Defined in: packages/@livestore/livestore/src/store/store-types.ts:442

The local head sequence number (most recent event in the client session). Represented as a string in the format “e{global}.{client}” (e.g., “e5.2”).


pendingCount: number

Defined in: packages/@livestore/livestore/src/store/store-types.ts:451

Number of events pending synchronization to the leader thread.


upstreamHead: string

Defined in: packages/@livestore/livestore/src/store/store-types.ts:447

The upstream head sequence number (what the leader thread has confirmed). Represented as a string in the format “e{global}” (e.g., “e3”).