AI Core/client Persistence

Browser chat persistence on useChat / ChatClient: localStoragePersistence, sessionStoragePersistence, indexedDBPersistence. Client-authoritative (adapter, full transcript) vs server-authoritative (persistence: true, no client cache). Reload restore, pending interrupts, mid-stream rejoin with delivery durability. Use for SPA reload durability — NOT server history alone. Also covers generation hooks (useGenerateImage etc.), which take only the server-driven mode: persistence: true hydrates the last generation for the (REQUIRED) threadId from the server on mount and repaints status/result/error, nothing is cached in the browser. No extra package: the adapters ship in the framework packages.

TanStack d0395c9 10.7 KB Updated

File contents

tanstack/ai/tree/main/packages/ai/skills/ai-core/client-persistence commit d0395c91d0

Frequently asked questions

npx skillmds@latest add tanstack/ai-core-client-persistence