A React Native wrapper around Android's EncryptedSharedPreferences and iOS Keychain to provide a secure alternative to Async Storage. Current version is 4.0.3, released Nov 2021. It supports Android API 21+ and iOS 2.0+. The package includes TypeScript definitions and exposes four async methods: setItem, getItem, removeItem, and clear. Unlike Async Storage, it encrypts data at rest. Requires manual linking for React Native < 0.60; auto-linking for 0.60+. No external dependencies beyond React Native.
npm install react-native-encrypted-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Stores a JSON object encrypted, retrieves it, and shows error handling with native error codes.
Migrate data using a migration script before upgrading to v3.
Clear Keychain on first launch using the Objective-C snippet provided in the README.
Ensure Android target API 21+ and test on multiple devices. Consider using a separate encryption library if issues arise.
Manually track stored keys in your app, e.g., store a list of keys in a separate key.
Always use await or .then() when calling methods.
Run `react-native link react-native-encrypted-storage` for RN <0.60, or check pod install for iOS (npx pod-install).
Use default import: `import EncryptedStorage from 'react-native-encrypted-storage';`
Wrap the call in an async function or use `.then()`.