Welcome to Storagefy
Storagefy is a unified adapter system for syncing your state management libraries (like Pinia, Zustand, Redux, Svelte stores, and more) with browser storage mechanisms like localStorage, sessionStorage, or IndexedDB.
It’s built to be framework-agnostic, lightweight, and highly composable — empowering you to persist your state across reloads and sessions in a clean, plug-and-play way.
Installation
npm install storagefy
Or with yarn:
yarn add storagefy
Adapters Overview
LocalStorageAdapter
Persists your state using the browser’s localStorage
.
Data survives across tabs and sessions. Great for most use cases that
need durable client-side persistence.
SessionStorageAdapter
Uses sessionStorage
for persistence that lasts only for the
duration of the browser tab. Perfect for sensitive or temporary state.
IndexedDBAdapter
Stores large and complex state structures asynchronously using IndexedDB. Ideal for offline-first applications or large-scale state.
Stores Overview
React Store Adapter
Seamlessly syncs state from React-based stores like Redux, Zustand, Jotai, or custom hooks to any supported storage adapter. Built for flexibility, supporting both controlled and uncontrolled stores.
Svelte Store Adapter
Automatically persists Svelte stores (like writable
, readable
) with minimal setup. Keeps reactivity intact and supports
auto-rehydration on load.
Vue (Pinia) Store Adapter
Integrates with Pinia (Vue 3’s store library) to persist state across sessions. Easy to plug into existing Pinia stores, enabling persistence without side effects.