Registry / storage / react-native-nitro-storage

react-native-nitro-storage

JSON →
library0.5.6jsnpmunverified

Synchronous React Native storage library (v0.5.6) powered by Nitro Modules and JSI. Supports typed Memory, Disk, and secure Keychain/Android Keystore storage with biometric authentication. Includes MMKV migration, Expo support, Zustand/Jotai persistence, and web IndexedDB compatibility. Built on the Nitro Modules framework for near-native performance. No async overhead, no bridging, no serialization bottlenecks. Actively maintained.

npm install react-native-nitro-storage
INSTALL
IMPORT
SIG · REACT-NATIVE-NITRO
R
react-native-nitro-storage
storagejavascriptv0.5.6
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.

NitroStorage
import { NitroStorage } from 'react-native-nitro-storage'
import NitroStorage from 'react-native-nitro-storage'
Named export; default export does not exist.
BiometricKeys
import { BiometricKeys } from 'react-native-nitro-storage'
Named export for biometric-protected storage. Requires additional native setup.
createNitroStorageSyncStorage
import { createNitroStorageSyncStorage } from 'react-native-nitro-storage'
import { createSyncStorage } from 'react-native-nitro-storage'
Exact named export; no abbreviated aliases.

Demonstrates basic synchronous storage, biometric secure storage, and Zustand persistence integration.

import { NitroStorage, BiometricKeys } from 'react-native-nitro-storage'; // Initialize disk storage with default path const storage = new NitroStorage(); // Set and get string storage.set('key', 'value'); const val = storage.getString('key'); // 'value' // Secure storage with biometrics const biometric = new BiometricKeys('com.yourapp.biometric', { authenticationPrompt: 'Authenticate to access secure data' }); biometric.set('secret', 'my_secret'); const secret = biometric.getString('secret'); // Persist Zustand store import { create } from 'zustand'; import { createNitroStorageSyncStorage } from 'react-native-nitro-storage'; const storageHelper = createNitroStorageSyncStorage({ storage: new NitroStorage() }); const useStore = create( persist( (set) => ({ count: 0 }), { name: 'app-storage', storage: storageHelper } ) );
Debug
Known issues
breakingRequires react-native-nitro-modules >=0.35.7 and react-native >=0.75.0. Older versions are incompatible.
fix
Upgrade React Native to >=0.75.0 and react-native-nitro-modules to >=0.35.7.
affects: <0.75.0 (RN) or <0.35.7 (nitro-modules)
deprecatedThe `load` method is deprecated in favor of direct synchronous getters (getString, getNumber, etc.).
fix
Use getString/getNumber/getBoolean/getData directly instead of load().
affects: >=0.5.0
gotchaBiometricKeys requires Face ID or Touch ID consent description on iOS (NSFaceIDUsageDescription) and BIOMETRIC_STRONG permission on Android. Missing configuration causes silent failures.
fix
Add NSFaceIDUsageDescription to Info.plist and BIOMETRIC_STRONG permission to AndroidManifest.xml.
affects: >=0.0.0
gotchaStored values are typed: setString, setNumber, setBoolean, setData. Using set with incompatible type returns undefined; no TypeScript guard.
fix
Use typed setters (setString, etc.) instead of generic set() to ensure type safety.
affects: >=0.0.0
deprecatedThe `clear` method removes all keys from the current scope. Data may be unrecoverable.
fix
Use delete(key) for individual removals or clearAll() with caution.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'react-native-nitro-modules' or its corresponding type declarations.
Missing peer dependency react-native-nitro-modules.
fix
Install the missing peer dependency: npm install react-native-nitro-modules
TypeError: (0, _NitroStorage.NitroStorage) is not a constructor
Using default import instead of named import.
fix
Change import to: import { NitroStorage } from 'react-native-nitro-storage'
Invariant Violation: BiometricKeys requires native module: NitroStorageBiometric
Missing native module registration for biometrics.
fix
Ensure the native build includes the biometric module (e.g., pod install on iOS, rebuild on Android).
Cannot read property 'set' of undefined
Instantiating NitroStorage without new keyword.
fix
Use new NitroStorage() instead of NitroStorage()
TypeError: storage.getString is not a function
Using the generic get() method which returns JSON. For typed access, use getString() etc.
fix
Use getString(), getNumber(), getBoolean(), or getData() accordingly.
Upgrade
Version history
0.5.6latest on npm
Audit
Dependencies
reactrequiredCore peer dependency for React Native integration
react-nativerequiredRuntime peer dependency
react-native-nitro-modulesrequiredRequired for Nitro Modules interop (JSI)
Agent activity
28 hits · last 30 days
node
24
Amazon
1
OpenAI (training)
1
Resources
react-native-nitro-storage — npm install react-native-nitro-storage · libregistry