@trustchex/react-native-sdk
v1.267.0
Published
Trustchex mobile app react native SDK for android or ios devices
Readme
@trustchex/react-native-sdk
React Native SDK for KYC and identity verification with document scanning, facial recognition, liveness detection, and NFC eID support.
⚠️ Commercial License Required - Contact [email protected] for licensing.
Features
- 📄 Document scanning (passport, ID cards) with OCR
- 🔍 MRZ processing for travel documents
- 📱 NFC eID card reading
- 👤 Facial recognition and liveness detection
- 🌐 Multi-language support (English, Turkish)
- 🎨 Customizable branding
- 🔗 Deep link support
- 📊 Privacy-compliant analytics (GDPR, KVKK, PCI-DSS)
Installation
npm install @trustchex/react-native-sdkRequired Dependencies
npm install @react-native-community/image-editor@^4.3.0 \
@react-navigation/native@^7.1.14 \
@react-navigation/native-stack@^7.3.21 \
lottie-react-native@^7.2.4 \
react-native-compressor@^1.12.0 \
react-native-fast-opencv@^0.4.6 \
react-native-fs@^2.20.0 \
react-native-gesture-handler@^2.27.1 \
react-native-get-random-values@^1.11.0 \
react-native-nfc-manager@^3.16.2 \
react-native-safe-area-context@^5.5.2 \
react-native-screens@^4.13.1 \
react-native-svg@^15.12.0 \
react-native-tts@^4.1.1 \
react-native-video@^6.16.1 \
react-native-vision-camera@^4.7.1 \
react-native-webview@^13.15.0 \
react-native-worklets-core@^1.6.2Setup
Babel Configuration (babel.config.js)
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
'react-native-worklets-core/plugin',
],
};iOS (Info.plist)
<!-- Permissions -->
<key>NSCameraUsageDescription</key>
<string>The app captures images of your ID, passport, and face, and records a video for
secure identity verification and ensure compliance with KYC regulations.</string>
<key>NSMicrophoneUsageDescription</key>
<string>The app records a video with audio for secure identity verification and ensure
compliance with KYC regulations.</string>
<key>NFCReaderUsageDescription</key>
<string>The app securely reads ID or passport data using NFC to verify your identity and
ensure compliance with KYC regulations.</string>
<!-- NFC Configuration -->
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
<string>TAG</string>
</array>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>E80704007F00070302</string>
<string>A000000167455349474E</string>
<string>A0000002480100</string>
<string>A0000002480200</string>
<string>A0000002480300</string>
<string>A00000045645444C2D3031</string>
</array>
<!-- Deep Link (optional) -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>your-app-scheme</string>
</array>
</dict>
</array>
<!-- Portrait Only -->
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>Android (AndroidManifest.xml)
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Hardware -->
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />
<application android:allowBackup="false">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:exported="true">
<!-- App Launcher -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- NFC -->
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<!-- Deep Link (optional) -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="your-app-scheme" />
</intent-filter>
</activity>
</application>Usage
Basic
import Trustchex from '@trustchex/react-native-sdk';
<Trustchex
baseUrl="https://your-server.com"
sessionId="session-id"
onCompleted={() => console.log('Completed')}
onError={(error) => console.error(error)}
/>With Branding
<Trustchex
baseUrl="https://your-server.com"
sessionId="session-id"
branding={{
logoUrl: 'https://your-logo.png',
primaryColor: '#1E3A8A',
secondaryColor: '#F3F4F6',
tertiaryColor: '#EF4444'
}}
locale="en" // 'en' | 'tr'
enableAnalytics={true}
onCompleted={() => console.log('Completed')}
onError={(error) => console.error(error)}
/>With Custom Analytics Tracking
import {
trackButtonClick,
trackScreenView,
analyticsService
} from '@trustchex/react-native-sdk';
// Track custom events
await trackButtonClick('custom_button', 'custom_screen');
await trackScreenView('custom_screen');
// Access analytics service directly
await analyticsService.clear(); // Right to be forgottenDeep Links
import { handleDeepLink } from '@trustchex/react-native-sdk';
const [baseUrl, sessionId] = handleDeepLink({
url: 'scheme://verification-session/abc123/app-url/api.server.com'
});API
| Prop | Type | Description |
|------|------|-------------|
| baseUrl | string? | Server URL |
| sessionId | string? | Verification session ID |
| branding | object? | Theme colors and logo |
| locale | 'en' \| 'tr'? | UI language |
| enableAnalytics | boolean? | Enable analytics (default: true) |
| onCompleted | function? | Success callback |
| onError | function? | Error callback |
Analytics
The SDK includes privacy-compliant analytics that respects GDPR, KVKK, and PCI-DSS regulations.
Key Features
- ✅ No PII collected - No names, emails, addresses, or personal data
- ✅ Data anonymization - Device identifiers excluded
- ✅ Right to deletion - Users can clear their data
Usage
Analytics is enabled by default. To customize:
<Trustchex
enableAnalytics={true} // Enable/disable analytics
{...otherProps}
/>For complete analytics documentation, see ANALYTICS.md.
Requirements
- React Native ≥ 0.79.5
- iOS ≥ 15.6 / Android ≥ API 31
- Camera required for document scanning
- NFC optional for eID cards
Troubleshooting
- Camera issues: Check permissions and device capability
- NFC not working: Enable NFC in device settings (optional feature)
- Build errors: Verify all peer dependencies are installed
License
Commercial license required. Contact [email protected] for pricing.
