Registry /
storage / react-native-nitro-storage
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.fixUpgrade 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.).fixUse 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.fixAdd 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.fixUse 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.fixUse 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.
fixInstall 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.
fixChange import to: import { NitroStorage } from 'react-native-nitro-storage' Invariant Violation: BiometricKeys requires native module: NitroStorageBiometric
Missing native module registration for biometrics.
fixEnsure 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.
fixUse 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.
fixUse getString(), getNumber(), getBoolean(), or getData() accordingly.
Audit
Dependencies
reactrequiredCore peer dependency for React Native integration
react-nativerequiredRuntime peer dependency
react-native-nitro-modulesrequiredRequired for Nitro Modules interop (JSI)