Skip to content

Storage Kit

Reactive localStorage, sessionStorage, IndexedDB and cookies for Vue 3 (and React) — TTL, encryption, schema migrations, undo/redo, and cross-tab sync.

Unified reactive API for all storages

useStorage works with localStorage, sessionStorage, IndexedDB, and in‑memory via a single interface. Reactive Refs for Vue and useSyncExternalStore for React automatically sync state with the chosen backend. Supports TTL, schema migrations, encryption, compression, signing, debounce/throttle, and history.

Schema migrations, TTL, and AES-GCM encryption

Version your data and auto‑apply migration chains (up/down) on structure changes. Set TTL for automatic removal of stale entries on read. Encrypt data via Web Crypto API (AES‑GCM) with PBKDF2 key derivation or a ready‑made CryptoKey, including key rotation.

Cross‑tab sync, undo/redo, and throttling

Enable sync for instant change propagation via BroadcastChannel (with storage event fallback). Optional leader election (navigator.locks) resolves conflicts by last‑write‑wins. Built‑in history (history: n) provides undo/redo without extra code, while debounce/throttle control write frequency.

Deep integration with the Vue and React ecosystem

The Vue plugin sets a global prefix, target, serializer, and error handler. The Nuxt module auto‑imports all composables and makes useCookie SSR‑aware (H3 on the server). The React version uses useSyncExternalStore, sharing one engine with Vue. Separate entry points for Pinia, DevTools, and testing.

Performance, SSR, and DevTools

Async adapters (including IndexedDB) don’t block rendering; isReady lets you show a skeleton until loading. On the server, an in‑memory fallback is used. Built‑in DevTools inspector shows all instances, their values, TTL, and history, while the timeline logs every change, migration, and error.