Skip to content

SingleTabAdapterOptions

SingleTabAdapterOptions = object

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:61

Options for the single-tab adapter.

This adapter is designed for browsers without SharedWorker support (e.g. Android Chrome). It provides OPFS persistence but without multi-tab synchronization.

optional clientId: string

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:94

By default the adapter will initially generate a random clientId (via nanoid(5)), store it in localStorage and restore it for subsequent client sessions.


optional experimental: object

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:102

optional disableFastPath: boolean

When set to true, the adapter will always start with a snapshot from the leader instead of trying to load a snapshot from storage.

false

optional resetPersistence: boolean

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:88

Warning: This will reset both the app and eventlog database. This should only be used during development.

false

optional sessionId: string

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:100

By default the adapter will initially generate a random sessionId (via nanoid(5)), store it in sessionStorage and restore it for subsequent client sessions in the same tab.


storage: StorageTypeEncoded

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:80

Storage configuration. Currently only OPFS is supported.


worker: (options) => globalThis.Worker | (options) => globalThis.Worker

Defined in: packages/@livestore/adapter-web/src/single-tab/single-tab-adapter.ts:75

The dedicated web worker that runs the LiveStore leader thread.

import LiveStoreWorker from './livestore.worker.ts?worker'
const adapter = makeSingleTabAdapter({
worker: LiveStoreWorker,
storage: { type: 'opfs' },
})