Registry / storage / redux-persist-webextension-storage

redux-persist-webextension-storage

JSON →
library1.0.2jsnpmunverified

A storage engine for redux-persist that uses the WebExtensions Storage API (chrome.storage) for persisting Redux state in browser extensions. Version 1.0.2 is the latest stable release, with no active development since 2019. It provides two engines: localStorage and syncStorage corresponding to chrome.storage.local and chrome.storage.sync. Differentiates from other engines by targeting WebExtensions specifically, leveraging the asynchronous, extension-specific storage that persists across browser sessions and syncs across devices when using sync storage.

npm install redux-persist-webextension-storage
INSTALL
IMPORT
SIG · REDUX-PERSIST-WEBE
R
redux-persist-webextension-storage
storagejavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

localStorage
import { localStorage } from 'redux-persist-webextension-storage'
import localStorage from 'redux-persist-webextension-storage'
Named import, not default. The package exports two named exports: localStorage and syncStorage.
syncStorage
import { syncStorage } from 'redux-persist-webextension-storage'
const { syncStorage } = require('redux-persist-webextension-storage')
Works with both ESM and CJS, but CJS pattern is allowed (require). Note: in a browser extension context, CJS may not work without bundling.
both engines
import { localStorage, syncStorage } from 'redux-persist-webextension-storage'
const reduxPersistWebExt = require('redux-persist-webextension-storage')
Multiple named imports in one statement.

Configures redux-persist with a WebExtension local storage engine for persisting Redux state in a browser extension.

import { combineReducers, createStore } from 'redux'; import { persistStore, persistReducer } from 'redux-persist'; import { localStorage } from 'redux-persist-webextension-storage'; import myReducer from './myReducer'; const persistConfig = { key: 'root', storage: localStorage, }; const persistedReducer = persistReducer(persistConfig, myReducer); const store = createStore(persistedReducer); const persistor = persistStore(store); export { store, persistor };
Debug
Known issues
gotchaThe storage engines are asynchronous and rely on chrome.storage API. Ensure you are running in a WebExtensions context (e.g., background script, popup).
fix
Test only in supported extension environments; not compatible with regular web pages or Node.js.
affects: >=0.0.0
gotchaThe localStorage export conflicts with the Web API's window.localStorage. Be careful not to shadow the native localStorage.
fix
Import with renaming: import { localStorage as webtLocalStorage } from 'redux-persist-webextension-storage'
affects: >=0.0.0
deprecatedNo updates since 2019; may not be compatible with newer versions of redux-persist (>=6) without additional configuration.
fix
Check redux-persist changelog; if breaking changes, consider using an alternative engine or fork.
affects: >=1.0.2
Errors
Common errors & fixes
Module not found: Can't resolve 'redux-persist-webextension-storage'
Package not installed or import path is correct but bundler cannot resolve due to missing dependency.
fix
Run npm install redux-persist-webextension-storage --save
TypeError: chrome.storage is undefined
Code running outside a WebExtensions environment (e.g., regular web page, Node.js) where chrome API is not available.
fix
Use only inside browser extension pages (background script, popup, etc.) or mock chrome.storage for testing.
Uncaught Error: Cannot find module './src/index'
Bundler trying to resolve source but missing main field or file not transpiled.
fix
Use a bundler that can handle ESM (e.g., Webpack, Rollup) or transpile the package if needed.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
redux-persistrequiredPeer dependency required to interface with redux-persist's persistReducer and persistStore.
Agent activity
20 hits · last 30 days
node
18
Amazon
1
Resources
redux-persist-webextension-storage — npm install redux-persist-webextension-storage · libregistry