Skip to content

makePersistedAdapter

makePersistedAdapter(options): Adapter

Defined in: index.ts:114

Creates a persisted LiveStore adapter for Expo/React Native applications.

This adapter stores data in SQLite databases on the device filesystem, providing persistence across app restarts. It supports optional sync backends for multi-device synchronization.

Requirements:

  • React Native New Architecture (Fabric) must be enabled
  • Expo SDK 51+ recommended

MakeDbOptions = {}

Adapter

import { makePersistedAdapter } from '@livestore/adapter-expo'
import { makeWsSync } from '@livestore/sync-cf/client'
const adapter = makePersistedAdapter({
sync: {
backend: makeWsSync({ url: 'wss://api.example.com/sync' }),
},
storage: {
subDirectory: 'my-app',
},
})
// Minimal setup without sync
const adapter = makePersistedAdapter()

https://livestore.dev/docs/reference/adapters/expo for detailed setup guide