LiveStore requires Node.js 18 or higher. Bun 1.2+ or pnpm are recommended for
the simplest dependency setup.
Install packages
Install LiveStore, the web adapter, and the Vue integration:Also install Vite plugins:
Configure Vite
Update your
vite.config.ts:vite.config.ts
The
worker: { format: 'es' } setting is required so that Vite bundles the
LiveStore web worker as an ES module.Create the web worker
Create
src/livestore/livestore.worker.ts. This file runs in a dedicated worker thread and manages the SQLite database.src/livestore/livestore.worker.ts
Set up LiveStoreProvider
Wrap your app root with The
<LiveStoreProvider> from vue-livestore. Configure the adapter and schema in the same component.src/App.vue
?worker and ?sharedworker suffixes tell Vite to bundle these imports as worker modules.Commit events
Use the
useStore composable from vue-livestore to access the store and commit events:src/components/AddTodo.vue