React Native and Expo SDK for KYC, KYB, biometric liveness, and AML. TypeScript API, native iOS and Android, NFC. Pay-per-call from $0.30, 500 free/month.
Native SDK: This is the recommended approach for React Native and Expo apps. The SDK wraps the native iOS and Android SDKs for the best user experience, optimized camera handling, and full NFC support.
That’s it. The plugin automatically configures both platforms:
Android: Adds the Didit Maven repository to Gradle and packaging exclusions
iOS: Adds the DiditSDK podspec to the Podfile
This SDK uses native modules (camera, NFC) that are not available in Expo Go. You must use a development build or run npx expo prebuild to generate the native projects.
Add the DiditSDK pod to your Podfile (it’s not on CocoaPods trunk):
# In your ios/Podfile, inside the target block:pod 'DiditSDK', :podspec => 'https://raw.githubusercontent.com/didit-protocol/sdk-ios/main/DiditSDK.podspec'
import { startVerification, VerificationStatus } from '@didit-protocol/sdk-react-native';// Start verification with a session token from your backendconst result = await startVerification('your-session-token');switch (result.type) { case 'completed': if (result.session.status === VerificationStatus.Approved) { console.log('Identity verified!'); } break; case 'cancelled': console.log('User cancelled'); break; case 'failed': console.log('Error:', result.error.message); break;}
import { startVerification } from '@didit-protocol/sdk-react-native';// Your backend creates a session and returns the tokenconst sessionToken = await yourBackend.createVerificationSession(userId);// Pass the token to the SDKconst result = await startVerification(sessionToken);
This approach gives you full control over:
Associating sessions with your users (vendor_data)
Custom font family name (must be registered natively)
loggingEnabled
boolean
false
Enable SDK debug logging
Theming & Colors: Colors, backgrounds, and intro screen settings are configured through your White Label settings in the Didit Console, not in the SDK configuration. This ensures consistent branding across all platforms.
Both startVerification and startVerificationWithWorkflow return a Promise<VerificationResult>. The result is a discriminated union — use the type field to determine the outcome.
import { startVerification, VerificationStatus, type VerificationResult,} from '@didit-protocol/sdk-react-native';async function verify(token: string) { const result: VerificationResult = await startVerification(token); switch (result.type) { case 'completed': switch (result.session.status) { case VerificationStatus.Approved: console.log('Approved! Session:', result.session.sessionId); // User is verified — grant access break; case VerificationStatus.Pending: console.log('Under review. Session:', result.session.sessionId); // Show "verification in progress" UI break; case VerificationStatus.Declined: console.log('Declined. Session:', result.session.sessionId); // Handle declined verification break; } break; case 'cancelled': console.log('User cancelled the verification.'); // Maybe show retry option break; case 'failed': console.log(`Error [${result.error.type}]: ${result.error.message}`); // Handle error — show retry or contact support break; }}