SQLite state adapter for Chat SDK built with better-sqlite3. Current stable version: 0.4.0. Release cadence: irregular, based on upstream Chat SDK updates. Key differentiators: lightweight local persistent state without Redis or Postgres, supports subscriptions, locking, caching, lists, and message queueing; automatic table creation and key prefix namespacing; opportunistic cleanup of expired entries. Requires Node >=20.10.0 and peer dependencies better-sqlite3 ^12.6.2 and chat ^4.23.0.
npm install chat-adapter-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Chat bot with an SQLite state adapter, specifying the database path.
Upgrade Node.js to v20.10.0 or later.
Explicitly pass path option when creating state adapter.
Call methods like get(), acquireLock() regularly to trigger cleanup, or implement a periodic cleanup mechanism.
Use Redis-based adapter for distributed locking.
Set SQLITE_PATH or pass path/client in options.
Pass `{ path: './data/chat.db' }` or set `SQLITE_PATH` environment variable, or provide an existing `better-sqlite3` client.Use `import { createSqliteState } from 'chat-adapter-sqlite'` instead of `require()`.Run `npm install better-sqlite3` or `pnpm add better-sqlite3`.