React Native
The React Native platform provides the highest level of security for production applications handling sensitive identity data.
Security Features
| Feature | Description |
|---|---|
| Hardware-Backed Keys | Secure Enclave (iOS) / Keystore (Android) |
| Isolated Storage | Keychain (iOS) / EncryptedSharedPreferences (Android) |
| No XSS Vector | Native code not vulnerable to web-based attacks |
| Certificate Pinning | Prevent MITM attacks on API communication |
Installation
1. Install Core Dependencies
npm install @dcid/sdk @react-native-async-storage/async-storage react-native-keychain2. Install HSM Native SDK
npm install metakeep-react-native-sdk3. iOS Configuration
The `metakeep-react-native-sdk` pod is auto-linked by React Native — no manual `pod` entry is needed.
4. Android Configuration
Initialization
Circuit Files
Zero-knowledge proof generation requires circuit files. The SDK bundles circuit files with your application for optimal performance and offline support.
Loading Priority:
- MMKV storage — Cached circuits from previous loads
- Bundled assets — Circuit files included with your app
The SDK uses MMKV for high-performance circuit caching on mobile devices. After the first load, circuits are stored in MMKV for instant access on subsequent proof generations.
Complete Integration Example
React Hooks Pattern
QR Code Scanning
Integrate with popular QR scanning libraries:
Performance Optimization
Circuit Preloading
Preload circuits during app startup for faster proof generation:
Native ZK Proof Performance
React Native uses native rapidsnark for ZK proof generation, providing significantly faster performance compared to WebAssembly in browser environments.
Troubleshooting
iOS: Always Open .xcworkspace
iOS: Xcode 26 Archive Errors
Xcode 26 changed the build system's dependency scanning phase to run before pod targets have built their products. If Archive fails with module map not found or header not found errors:
If your Podfile includes custom pods that use module maps referenced via PODS_CONFIGURATION_BUILD_DIR, you may need to add a script_phase with :execution_position => :before_compile to copy those module maps before the scan phase runs.
iOS: Duplicate Symbols
Android ProGuard
-keep class com.metakeep.** { *; }
-keep class io.dcid.sdk.** { *; }HSM Initialization Failure
Next Steps
- Authentication Guide
- Credential Management
- API Reference