Registry / storage / redux-persist-sensitive-storage

redux-persist-sensitive-storage

JSON →
library1.0.0jsnpmunverified

A storage engine for redux-persist that uses react-native-sensitive-info to persist Redux state securely on iOS (Keychain) and Android (Shared Preferences). Version 1.0.0 is stable with no recent updates. Peer dependencies require react-native-sensitive-info 3.x-5.x. Differentiates from AsyncStorage-based persistence by targeting sensitive data, though Android Shared Preferences are not fully secure; a keystore branch is available for stronger encryption.

npm install redux-persist-sensitive-storage
INSTALL
IMPORT
SIG · REDUX-PERSIST-SENS
R
redux-persist-sensitive-storage
storagejavascriptv1.0.0
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.

default
import createSensitiveStorage from 'redux-persist-sensitive-storage';
const createSensitiveStorage = require('redux-persist-sensitive-storage');
ESM default export only; use default import pattern.
createSensitiveStorage
import createSensitiveStorage from 'redux-persist-sensitive-storage';
import { createSensitiveStorage } from 'redux-persist-sensitive-storage';
No named export; default export is the function.
createSensitiveStorage (TypeScript)
import createSensitiveStorage from 'redux-persist-sensitive-storage';
import * as SensitiveStorage from 'redux-persist-sensitive-storage';
TypeScript module resolution expects default import; no namespace import.

Configures redux-persist with the sensitive storage engine using optional iOS keychain service and Android shared preferences name.

import { createStore, compose, applyMiddleware } from 'redux'; import { persistStore, autoRehydrate } from 'redux-persist'; import createSensitiveStorage from 'redux-persist-sensitive-storage'; const reducer = (state = {}, action) => state; const store = createStore( reducer, compose( applyMiddleware(), autoRehydrate() ) ); persistStore(store, { storage: createSensitiveStorage({ keychainService: 'myKeychain', sharedPreferencesName: 'mySharedPrefs' }) });
Debug
Known issues
gotchaAndroid Shared Preferences are not encrypted; use the keystore branch of react-native-sensitive-info for security.
fix
Use the 'keystore' branch of react-native-sensitive-info or switch to a fully encrypted storage solution.
affects: all
deprecatedautoRehydrate is removed in redux-persist v6; use persistReducer or persistCombineReducers instead.
fix
Migrate to redux-persist v6+ API: wrap reducers with persistReducer, and import persistStore from 'redux-persist'.
affects: >=0.0.0
breakingAPI change: createSensitiveStorage now returns a storage object directly, not a function that returns a storage.
fix
Call createSensitiveStorage without 'new' and pass the returned object as the storage option.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Cannot read property 'getItem' of undefined
Storage engine not properly initialized or imported
fix
Ensure createSensitiveStorage is called and the result is passed as the storage option to persistStore.
Module not found: Can't resolve 'react-native-sensitive-info'
Missing peer dependency
fix
Run 'npm install react-native-sensitive-info' or 'yarn add react-native-sensitive-info' and link with 'react-native link react-native-sensitive-info'.
Error: Could not connect to React Native dev tools
react-native-sensitive-info native module not linked properly
fix
Run 'react-native link react-native-sensitive-info' or manually link the native module.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
react-nativerequiredpeer dependency: required at runtime
react-native-sensitive-inforequiredpeer dependency: the underlying encryption library
Agent activity
18 hits · last 30 days
node
16
Amazon
1
Resources
redux-persist-sensitive-storage — npm install redux-persist-sensitive-storage · libregistry