Registry / storage / redux-persist-encrypted-storage

redux-persist-encrypted-storage

JSON →
library1.1.1jsnpmunverified

Storage engine for redux-persist that wraps react-native-encrypted-storage to provide encrypted on-device persistence using Android EncryptedSharedPreferences and iOS Keychain. Version 1.1.1, released under MIT license. Ships TypeScript definitions. Key differentiator is use of native encryption (AES-based) instead of base64 or simple AsyncStorage, with automatic key sanitization to allowed characters [A-Za-z0-9.-_]. Requires react-native-encrypted-storage as a peer dependency and react-native environment. Designed as a drop-in replacement for AsyncStorage in redux-persist persist config.

npm install redux-persist-encrypted-storage
INSTALL
IMPORT
SIG · REDUX-PERSIST-ENCR
R
redux-persist-encrypted-storage
storagejavascriptv1.1.1
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.

createSecuredStorage
import createSecuredStorage from 'redux-persist-encrypted-storage'
const createSecuredStorage = require('redux-persist-encrypted-storage')
Default export, ESM-only. CommonJS require will not work unless bundler supports interop.

Integrates encrypted storage as the global storage engine for redux-persist.

import createSecuredStorage from 'redux-persist-encrypted-storage'; import { persistStore, persistReducer } from 'redux-persist'; import { createStore } from 'redux'; import rootReducer from './reducers'; const secureStorage = createSecuredStorage(); const persistConfig = { key: 'secure', storage: secureStorage, }; const persistedReducer = persistReducer(persistConfig, rootReducer); const store = createStore(persistedReducer); const persistor = persistStore(store); export { store, persistor };
Debug
Known issues
gotchaStorage keys are limited to characters [A-Za-z0-9.-_]; all others are replaced with underscore.
fix
Ensure your persist key and reducer keys contain only allowed characters or use the custom replacer option.
affects: >=0.0.0
gotchaThis library only works in React Native environments; not compatible with web or Expo without ejecting.
fix
Use a different storage engine for web (e.g., redux-persist-filesystem-storage) or run in a React Native app.
affects: >=0.0.0
deprecatedThe library does not support the newer redux-persist v6 API changes like stateReconciler or serialize/deserialize options fully.
fix
Check redux-persist v6 migration docs. If using v6, ensure your config is compatible with custom storage engines.
affects: >=1.0.0
Errors
Common errors & fixes
Module "redux-persist-encrypted-storage" does not exist in the Haste module map
Missing peer dependency react-native-encrypted-storage or misconfigured React Native environment.
fix
Run npm install react-native-encrypted-storage and then cd ios && pod install (for iOS).
TypeError: secureStorage.getItem is not a function
Incorrect usage of createSecuredStorage() result; it returns an object, not a function.
fix
Assign result to a variable and pass it as `storage` in persist config, e.g., const secureStorage = createSecuredStorage(); config.storage = secureStorage;
Invalid key format. Only [A-Za-z0-9.-_] allowed.
Persist key contains characters like spaces, slashes, or special symbols.
fix
Use only letters, digits, hyphens, dots, underscores in your persist config key.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
react-native-encrypted-storagerequiredProvides the underlying native encryption for Android and iOS secure storage.
Agent activity
27 hits · last 30 days
node
22
Amazon
1
Resources
redux-persist-encrypted-storage — npm install redux-persist-encrypted-storage · libregistry