> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# मोबाइल KYC SDK: React Native सत्यापन

> Didit का React Native/Expo KYC SDK: TypeScript, नेटिव iOS-Android, NFC ई-पासपोर्ट। प्रति पूर्ण KYC जाँच $0.33 से, $10 मुफ़्त/माह, कोई अनुबंध नहीं।



React Native SDK इंटीग्रेशन प्रॉम्प्ट
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\`Integrate Didit identity verification into my React Native app using the native SDK.

\## Requirements
\- React Native 0.76+ (New Architecture / TurboModules)
\- Node.js 20+, TypeScript 5+
\- iOS 13.0+ (NFC requires iOS 15+)
\- Android API 24+ (Android 7.0), Kotlin 1.9+, Java 17+
\- New Architecture (TurboModules) only - package is published as @didit-protocol/sdk-react-native v4.x (latest 4.13.2)

\## Installation

\### Expo (recommended)
npx expo install @didit-protocol/sdk-react-native

Add to app.json (NFC is enabled by default):
\{
"expo": {
"plugins": ["@didit-protocol/sdk-react-native"]
}
}

To opt out of NFC dependencies:
\{
"expo": {
"plugins": [["@didit-protocol/sdk-react-native", { "iosNfcEnabled": false, "androidNfcEnabled": false }]]
}
}

The config plugin automatically adds the Didit Maven repo (Android), the DiditSDK podspec (iOS),
and BouncyCastle packaging rules for Android. This SDK requires a development build — it does not work in Expo Go.
The plugin does not edit Info.plist: add the iOS permission keys and, for NFC, the ISO7816 select identifiers
(including D392F000260100000001 for the Japan My Number Card) under expo.ios.infoPlist in app.json.

\### React Native CLI
npm install @didit-protocol/sdk-react-native

iOS — add this block to ios/Podfile inside the app target (NFC-aware; pins to iOS 15 when NFC is on):
didit_sdk_ios_nfc_enabled = ENV.fetch('DIDIT_SDK_IOS_NFC_ENABLED', 'true').downcase != 'false'
didit_sdk_ios_pod = didit_sdk_ios_nfc_enabled ? 'DiditSDK' : 'DiditSDK/Core'
pod didit_sdk_ios_pod, :podspec => 'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.13.2/DiditSDK.podspec'
The tag in that URL must equal diditNativeSdkVersions.ios in the package (4.13.2); do not use 'main', because the package requires that exact version and every pod install fails when the URL resolves to a different one.
Then: cd ios && bundle exec pod install

Android — add to settings.gradle (dependencyResolutionManagement.repositories):
maven { url "https://raw.githubusercontent.com/didit-protocol/sdk-android/main/repository" }
To disable NFC, add diditSdkAndroidNfcEnabled=false to android/gradle.properties.

\## Backend: Create Session (your server)
POST https://verification.didit.me/v3/session/
Headers: { "x-api-key": DIDIT_API_KEY, "Content-Type": "application/json" }
Body: { "workflow_id": DIDIT_WORKFLOW_ID, "vendor_data": "user-id" }
Response: { "session_id": "uuid", "session_token": "short-token", "url": "https://verify.didit.me/session/short-token", "status": "Not Started" }
Send session_token to the React Native app (never expose DIDIT_API_KEY to the device).

\## Integration
import { startVerification, VerificationStatus } from '@didit-protocol/sdk-react-native';

// Option A: With session token from your backend (recommended)
const result = await startVerification('session-token-from-backend');

// Option B: With workflow ID (SDK creates session internally)
const result = await startVerificationWithWorkflow('your-workflow-id', {
vendorData: 'user-123',
});

// Handle result
switch (result.type) {
case 'completed':
if (result.session.status === VerificationStatus.Approved) { /* grant access */ }
break;
case 'cancelled':
// User dismissed the verification flow
break;
case 'failed':
// SDK error — show result.error.message
break;
}

\## Result Statuses (VerificationStatus enum)
\- VerificationStatus.Approved — user identity verified, grant access
\- VerificationStatus.Declined — verification failed, show retry or contact support
\- VerificationStatus.Pending  — needs manual review by your compliance team

\## Full Verification Results
The SDK only returns the status. Full decision data (document fields, face match scores, AML hits, etc.) arrives via webhook to your backend.
Set up webhooks: https://docs.didit.me/integration/webhooks

\## Rate Limits (session creation)
\- 600 session-create requests / minute per x-api-key (see https://docs.didit.me/integration/rate-limiting)
\- On 429, retry honouring Retry-After / X-RateLimit-* headers

\## Environment Variables (backend only — never expose in the app)
\- DIDIT_API_KEY — from Didit Console > API & Webhooks
\- DIDIT_WORKFLOW_ID — from Didit Console > Workflows

\## Docs
\- React Native SDK: https://docs.didit.me/integration/native-sdks/react-native-sdk
\- GitHub: https://github.com/didit-protocol/sdk-react-native
\- npm: https://www.npmjs.com/package/@didit-protocol/sdk-react-native
\- Webhooks: https://docs.didit.me/integration/webhooks
\- API Reference: https://docs.didit.me/api-reference/overview`

\</pre>



      
      

यहाँ पेस्ट करें

एक क्रॉस-प्लेटफ़ॉर्म React Native SDK जो मूल iOS और Android SDKs को रैप करता है और पहचान सत्यापन के लिए एकीकृत TypeScript API प्रदान करता है।> [card] [GitHub रिपॉज़िटरी](https://github.com/didit-protocol/sdk-react-native)
>
> GitHub पर सोर्स कोड और उदाहरण देखें> [card] [npm पैकेज](https://www.npmjs.com/package/@didit-protocol/sdk-react-native)
>
> @didit-protocol/sdk-react-native> [!NOTE]
>
> ### **नेटिव SDK**: React Native और Expo ऐप्स के लिए यही अनुशंसित तरीका है। यह SDK बेहतर उपयोगकर्ता अनुभव, अनुकूलित कैमरा हैंडलिंग और पूर्ण NFC समर्थन के लिए मूल iOS और Android SDKs को रैप करता है।***## आवश्यकताएँ| आवश्यकता | न्यूनतम संस्करण |
| - | - |
| React Native | 0.76+ (New Architecture / TurboModules) |
| Node.js | 20+ |
| TypeScript | 5+ |### प्लेटफ़ॉर्म आवश्यकताएँ| प्लेटफ़ॉर्म | न्यूनतम संस्करण | टिप्पणियाँ |
| - | - | - |
| iOS | 13.0+ | NFC पासपोर्ट रीडिंग के लिए iOS 15.0+ आवश्यक है |
| Android | API 24+ (7.0) | Kotlin 1.9+, Java 17+ |> [!NOTE]
>
> **बायोमेट्रिक सहमति के लिए नेटिव 4.10.0 या उसके बाद का संस्करण चाहिए।** इलिनॉय, टेक्सास या कोलोराडो कानून के दायरे में आने वाले लोगों के लिए, Didit पहली बार चेहरा कैप्चर करने से पहले स्पष्ट [बायोमेट्रिक सहमति](https://docs.didit.me/hi/getting-started/biometric-consent.md) माँग सकता है। नेटिव iOS और Android 4.10.0 या उसके बाद के संस्करण पिन करने वाला React Native SDK रिलीज़ यह चरण दिखाता है। इससे पुराने संस्करण यह चरण नहीं दिखा सकते: उनके सत्र पहले की तरह चलते हैं, और निर्णय में सहमति एकत्र नहीं की गई होने की रिपोर्ट होती है (`biometric_consent.reason: "BIOMETRIC_CONSENT_UNSUPPORTED_SDK"`)। यदि आप इन राज्यों में लोगों का सत्यापन करते हैं, तो अपग्रेड करें।***## इंस्टॉलेशन### Expo (अनुशंसित)```bash theme={null}
npx expo install @didit-protocol/sdk-react-native
```इसके बाद अपनी `app.json` (या `app.config.js`) में config plugin जोड़ें। NFC डिफ़ॉल्ट रूप से सक्षम है:```json theme={null}
{
  "expo": {
    "plugins": ["@didit-protocol/sdk-react-native"]
  }
}
```Plugin दोनों प्लेटफ़ॉर्म को अपने आप कॉन्फ़िगर करता है:- **Android:** Gradle में Didit Maven repository जोड़ता है, `diditSdkAndroidNfcEnabled` Gradle property सेट करता है, और BouncyCastle dependency/packaging नियम लागू करता है
- **iOS:** Podfile में DiditSDK podspec जोड़ता है (NFC सक्षम होने पर iOS 15 पर पिन किया जाता है)Plugin `Info.plist` में बदलाव नहीं करता। [iOS अनुमति कुंजियाँ](#ios) जोड़ें, और NFC के लिए उसी फ़ाइल में `ios.infoPlist` के अंतर्गत ISO7816 select identifiers भी जोड़ें। `D392F000260100000001` SDK को [JPKI](https://docs.didit.me/hi/core-technology/nfc-verification/overview.md#japan-my-number-card-jpki) के माध्यम से Japan My Number Card पढ़ने देता है:```json theme={null}
{
  "expo": {
    "ios": {
      "infoPlist": {
        "NFCReaderUsageDescription": "NFC is used to read passport chip data for identity verification.",
        "com.apple.developer.nfc.readersession.iso7816.select-identifiers": [
          "D23300000045737445494420763335",
          "A0000002471001",
          "A0000002472001",
          "00000000000000",
          "D392F000260100000001"
        ]
      }
    }
  }
}
```#### NFC निर्भरताएँ अक्षम करनाNFC समर्थन के बिना बिल्ड करने के लिए (छोटा बाइनरी, NFC क्षमता की आवश्यकता नहीं), plugin options पास करें:```json theme={null}
{
  "expo": {
    "plugins": [
      [
        "@didit-protocol/sdk-react-native",
        { "iosNfcEnabled": false, "androidNfcEnabled": false }
      ]
    ]
  }
}
```जब NFC अक्षम हो, तो आपको iOS NFC capability, NFC entitlements, या NFC से संबंधित provisioning सेटअप की आवश्यकता नहीं होती।> [!WARNING]
>
> यह SDK ऐसे नेटिव मॉड्यूल (कैमरा, NFC) का उपयोग करता है जो **Expo Go में उपलब्ध नहीं हैं**। आपको [डेवलपमेंट बिल्ड](https://docs.expo.dev/develop/development-builds/introduction/) का उपयोग करना होगा या native projects बनाने के लिए `npx expo prebuild` चलाना होगा।### React Native CLI```bash theme={null}
npm install @didit-protocol/sdk-react-native
# or
yarn add @didit-protocol/sdk-react-native
```#### iOS सेटअपअपनी `Podfile` में DiditSDK pod जोड़ें (यह CocoaPods trunk पर उपलब्ध नहीं है)। नीचे दिया गया block `DIDIT_SDK_IOS_NFC_ENABLED` environment variable का उपयोग करता है, ताकि आप install के समय no-NFC subspec (`DiditSDK/Core`) को टॉगल कर सकें:```ruby theme={null}
# In your ios/Podfile — at the top, before the target block:
didit_sdk_ios_nfc_enabled = ENV.fetch('DIDIT_SDK_IOS_NFC_ENABLED', 'true').downcase != 'false'

def max_ios_version(*versions)
  versions.map(&:to_s).max_by { |version| Gem::Version.new(version) }
end

platform :ios, didit_sdk_ios_nfc_enabled ? max_ios_version(min_ios_version_supported, '15.0') : min_ios_version_supported

# Inside your app target:
didit_sdk_ios_pod = didit_sdk_ios_nfc_enabled ? 'DiditSDK' : 'DiditSDK/Core'
pod didit_sdk_ios_pod, :podspec => 'https://raw.githubusercontent.com/didit-protocol/sdk-ios/4.13.2/DiditSDK.podspec'
```> [!WARNING]
>
> Podspec URL में दिया गया tag इंस्टॉल किए गए package version में `diditNativeSdkVersions.ios` से मेल खाना चाहिए।
> React Native `4.13.2` native iOS `4.13.2` और native Android `4.13.2` को पिन करता है। Podspec को `main` की ओर इंगित न करें: यह package ठीक उसी native iOS version पर निर्भर करता है, इसलिए जैसे ही `main` आगे बढ़ेगा, CocoaPods `DiditSDK` के लिए दो असंगत आवश्यकताएँ देखेगा और हर `pod install` विफल हो जाएगा। Expo config plugin यह URL आपके लिए तैयार करता है; केवल bare React Native CLI के मामले में इसे हाथ से लिखना पड़ता है।इसके बाद dependencies इंस्टॉल करें:```bash theme={null}
cd ios
bundle exec pod install
```NFC dependencies के बिना दोबारा बिल्ड करने के लिए, CocoaPods को साफ़ करें और environment variable सेट करके फिर से चलाएँ:```bash theme={null}
cd ios
rm -rf Pods Podfile.lock
DIDIT_SDK_IOS_NFC_ENABLED=false bundle exec pod install
```#### Android सेटअपअपनी project-level `settings.gradle` में Didit Maven repository जोड़ें:```groovy theme={null}
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url "https://raw.githubusercontent.com/didit-protocol/sdk-android/main/repository" }
    }
}
```अपनी ऐप की `android/app/build.gradle` में (`android { ... }` block के भीतर) निम्न जोड़ें, ताकि BouncyCastle duplicate-class conflicts और OSGI `MANIFEST.MF` duplicate हल हो सकें, जो DiditSDK के transitive dependencies उत्पन्न कर सकती हैं:```groovy theme={null}
android {
    configurations.configureEach {
        exclude group: 'org.bouncycastle', module: 'bcprov-jdk15to18'
        exclude group: 'org.bouncycastle', module: 'bcutil-jdk15to18'
        exclude group: 'org.bouncycastle', module: 'bcpkix-jdk15to18'
        exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on'
    }
    packaging {
        resources {
            pickFirsts += ['org/bouncycastle/**']
            excludes += 'META-INF/versions/9/OSGI-INF/MANIFEST.MF'
        }
    }
}
```Android NFC dependencies के बिना बिल्ड करने के लिए (`me.didit:didit-sdk` के बजाय `me.didit:didit-sdk-core` artifact उपयोग करता है), `android/gradle.properties` में यह जोड़ें:```properties theme={null}
diditSdkAndroidNfcEnabled=false
```NFC के साथ पूर्ण Android SDK उपयोग करने के लिए वह property हटाएँ, या उसे `true` पर सेट करें।***## अनुमतियाँ### iOSअपने ऐप की `Info.plist` में निम्नलिखित कुंजियाँ जोड़ें। आवश्यक iOS गोपनीयता कुंजियाँ न होने पर, SDK के उस संरक्षित संसाधन तक पहुँचते ही iOS ऐप को बंद कर देगा।| अनुमति | Info.plist कुंजी | विवरण | आवश्यक |
| - | - | - | - |
| कैमरा | `NSCameraUsageDescription` | दस्तावेज़ स्कैनिंग और चेहरा सत्यापन | हाँ |
| माइक्रोफ़ोन | `NSMicrophoneUsageDescription` | लाइवनेस वीडियो रिकॉर्डिंग | हाँ |
| फ़ोटो लाइब्रेरी | `NSPhotoLibraryUsageDescription` | दस्तावेज़ की छवियाँ अपलोड करना | हाँ |
| स्थान | `NSLocationWhenInUseUsageDescription` | धोखाधड़ी रोकथाम के लिए भू-स्थिति | हाँ |
| NFC | `NFCReaderUsageDescription` | पासपोर्ट/ID कार्ड की चिप पढ़ना | यदि NFC का उपयोग कर रहे हैं |```xml theme={null}
<key>NSCameraUsageDescription</key>
<string>Camera access is required to scan your identity documents for verification.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required to record video for liveness verification.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is required to upload document images.</string>
<key>NFCReaderUsageDescription</key>
<string>NFC is used to read passport chip data for identity verification.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location access is used to detect your country for identity verification.</string>
```#### NFC कॉन्फ़िगरेशनचिप वाले पासपोर्ट और ID कार्ड के लिए NFC रीडिंग सक्षम करने हेतु:1) Xcode में **NFC Capability** जोड़ें:
   * अपना टार्गेट चुनें > **Signing & Capabilities** > **+ Capability** > **Near Field Communication Tag Reading**

2) **ISO7816 पहचानकर्ता** को `Info.plist` में जोड़ें:```xml theme={null}
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
    <string>D23300000045737445494420763335</string>
    <string>A0000002471001</string>
    <string>A0000002472001</string>
    <string>00000000000000</string>
    <string>D392F000260100000001</string>
</array>
````D392F000260100000001` SDK को [JPKI](https://docs.didit.me/hi/core-technology/nfc-verification/overview.md#japan-my-number-card-jpki) के माध्यम से Japan My Number Card पढ़ने देता है। इसके बिना iOS इस कार्ड की जानकारी SDK को नहीं देता। My Number Card रीडिंग अभी प्रोडक्शन में सक्षम नहीं है, और यह पहचानकर्ता अन्य दस्तावेज़ों पर कोई असर नहीं डालता, इसलिए आप इसे अभी जोड़ सकते हैं।3) NFC टैग रीडिंग सक्षम करके **एंटाइटलमेंट फ़ाइल** जोड़ें:```xml theme={null}
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
    <string>TAG</string>
</array>
```सुनिश्चित करें कि ऐप की प्रोविज़निंग प्रोफ़ाइल में NFC Tag Reading क्षमता शामिल हो। जब NFC अक्षम हो, तब यह NFC कॉन्फ़िगरेशन आवश्यक नहीं है।### AndroidSDK की `AndroidManifest.xml` में निम्नलिखित अनुमतियाँ घोषित हैं और अपने आप मर्ज हो जाती हैं:| अनुमति | विवरण | आवश्यक |
| - | - | - |
| `INTERNET` | API संचार के लिए नेटवर्क पहुँच | हाँ |
| `ACCESS_NETWORK_STATE` | नेटवर्क उपलब्धता जाँचना | हाँ |
| `CAMERA` | दस्तावेज़ स्कैनिंग और चेहरा सत्यापन | हाँ |
| `NFC` | पासपोर्ट/ID कार्ड की चिप पढ़ना | यदि NFC का उपयोग कर रहे हैं |कैमरा और NFC हार्डवेयर सुविधाएँ वैकल्पिक (`android:required="false"`) घोषित हैं, ताकि आपका ऐप इन सुविधाओं के बिना उपकरणों पर भी इंस्टॉल हो सके।***## त्वरित शुरुआत```tsx theme={null}
import { startVerification, VerificationStatus } from '@didit-protocol/sdk-react-native';

// Start verification with a session token from your backend
const 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;
}
```***## इंटीग्रेशन विधियाँSDK दो इंटीग्रेशन विधियों का समर्थन करता है:### विधि 1: सत्र टोकन (प्रोडक्शन के लिए अनुशंसित)[Create Verification Session API](https://docs.didit.me/hi/sessions-api/create-session.md) का उपयोग करके अपने बैकएंड पर सत्र बनाएँ, फिर टोकन SDK को दें:```tsx theme={null}
import { startVerification } from '@didit-protocol/sdk-react-native';

// Your backend creates a session and returns the token
const sessionToken = await yourBackend.createVerificationSession(userId);

// Pass the token to the SDK
const result = await startVerification(sessionToken);
```यह तरीका इन पर आपको पूरा नियंत्रण देता है:- सत्र को अपने उपयोगकर्ताओं से जोड़ना (`vendor_data`)
- कस्टम मेटाडेटा सेट करना
- प्रति सत्र कॉलबैक कॉन्फ़िगर करना### विधि 2: वर्कफ़्लो ID (सरल इंटीग्रेशन)सरल इंटीग्रेशन के लिए, SDK आपके वर्कफ़्लो ID का उपयोग करके सीधे सत्र बना सकता है:```tsx theme={null}
import { startVerificationWithWorkflow } from '@didit-protocol/sdk-react-native';

const result = await startVerificationWithWorkflow('your-workflow-id', {
  vendorData: 'user-123',
  contactDetails: { email: 'user@example.com' },
  config: { loggingEnabled: true },
});
```***## कॉन्फ़िगरेशन`DiditConfig` ऑब्जेक्ट पास करके SDK के व्यवहार को अनुकूलित करें:```tsx theme={null}
const result = await startVerification('your-session-token', {
  languageCode: 'es',           // Force Spanish language
  showLanguageSelector: true,   // Let the user change language
  fontFamily: 'Avenir',         // Custom font (must be registered natively)
  loggingEnabled: true,         // Enable debug logging
  showCloseButton: true,        // Show close (X) button on step screens
  showExitConfirmation: true,   // Confirm before exit
  closeOnComplete: false,       // Auto-dismiss UI on completion
});
````startVerificationWithWorkflow` के लिए, कॉन्फ़िगरेशन को `options.config` के अंदर पास करें:```tsx theme={null}
const result = await startVerificationWithWorkflow('your-workflow-id', {
  vendorData: 'user-123',
  config: {
    languageCode: 'es',
    showLanguageSelector: true,
    loggingEnabled: true,
    showCloseButton: true,
    showExitConfirmation: true,
  },
});
```### कॉन्फ़िगरेशन विकल्प| प्रॉपर्टी | प्रकार | डिफ़ॉल्ट | विवरण |
| - | - | - | - |
| `languageCode` | `string` | डिवाइस लोकेल | ISO 639-1 भाषा कोड (जैसे `"en"`, `"fr"`, `"ar"`) |
| `showLanguageSelector` | `boolean` | `false` | स्वागत स्क्रीन पर वेब-शैली का भाषा चयनकर्ता दिखाएँ |
| `fontFamily` | `string` | सिस्टम फ़ॉन्ट | कस्टम फ़ॉन्ट फ़ैमिली नाम (नेटिव रूप से रजिस्टर्ड होना आवश्यक) |
| `loggingEnabled` | `boolean` | `false` | SDK डीबग लॉगिंग सक्षम करें |
| `showCloseButton` | `boolean` | `true` | सत्यापन चरण की स्क्रीन पर बंद करने (X) बटन दिखाएँ |
| `showExitConfirmation` | `boolean` | `true` | उपयोगकर्ता के बाहर निकलने का प्रयास करने पर पुष्टि संवाद दिखाएँ |
| `closeOnComplete` | `boolean` | `false` | पूरा होने पर सत्यापन UI अपने आप बंद करें |
| `defaultDocumentCamera` | `CameraLens?` | नेटिव डिफ़ॉल्ट (`CameraLens.Back`) | दस्तावेज़ कैप्चर स्क्रीन खुलने पर उपयोग होने वाला लेंस |
| `defaultLivenessCamera` | `CameraLens?` | नेटिव डिफ़ॉल्ट (`CameraLens.Front`) | चेहरा (लाइवनेस) कैप्चर स्क्रीन खुलने पर उपयोग होने वाला लेंस |
| `showDocumentCameraSwitchButton` | `boolean` | `true` | दस्तावेज़ कैप्चर स्क्रीन पर कैप्चर के दौरान कैमरा स्विचर दिखाएँ |
| `showLivenessCameraSwitchButton` | `boolean` | `true` | चेहरा कैप्चर स्क्रीन पर कैप्चर के दौरान कैमरा स्विचर दिखाएँ |### कैमरा विकल्पकैमरा विकल्प [Web SDK कैमरा विकल्पों](https://docs.didit.me/hi/integration/web-sdks/javascript-sdk.md#कैमरा-विकल्प) से मेल खाते हैं।
हर लेंस `CameraLens.Front` या `CameraLens.Back` होता है।
यदि डिवाइस में अनुरोधित लेंस नहीं है, तो SDK वह पहला कैमरा उपयोग करता है जो उसके पास है।
जिन डिवाइसों में केवल एक कैमरा है, वहाँ कैमरा स्विचर भी छिपा रहता है।
उपयोगकर्ता को उस चरण के डिफ़ॉल्ट लेंस तक सीमित रखने के लिए किसी स्विचर विकल्प को `false` पर सेट करें।```tsx theme={null}
import { startVerification, CameraLens } from '@didit-protocol/sdk-react-native';

await startVerification('your-session-token', {
  defaultLivenessCamera: CameraLens.Back,
  showLivenessCameraSwitchButton: false,
});
```> [!NOTE]
>
> **थीमिंग और रंग**: रंग, पृष्ठभूमि और परिचय स्क्रीन की सेटिंग्स SDK कॉन्फ़िगरेशन में नहीं, बल्कि Didit Console में आपकी [व्हाइट लेबल सेटिंग्स](https://business.didit.me) के माध्यम से कॉन्फ़िगर की जाती हैं। इससे सभी प्लेटफ़ॉर्म पर एक समान ब्रांडिंग सुनिश्चित होती है।***## भाषा समर्थनSDK **54 भाषाओं का समर्थन करता है**। यदि कोई भाषा निर्दिष्ट नहीं है, तो SDK डिवाइस लोकेल का उपयोग करता है और फ़ॉलबैक के रूप में अंग्रेज़ी लेता है।```tsx theme={null}
// Use device locale (default)
await startVerification(token);

// Force specific language
await startVerification(token, { languageCode: 'fr' });

// Let the user change language on the welcome screen
await startVerification(token, { showLanguageSelector: true });
```**[सभी समर्थित भाषाएँ देखें →](https://docs.didit.me/hi/integration/supported-languages.md)*****## उन्नत विकल्पये विकल्प केवल `startVerificationWithWorkflow` के साथ उपलब्ध हैं, जहाँ SDK आपकी ओर से सत्र बनाता है।### संपर्क विवरण (प्रीफ़िल और सूचनाएँ)सत्यापन फ़ॉर्म को प्रीफ़िल करने और ईमेल सूचनाएँ सक्षम करने के लिए संपर्क विवरण दें:```tsx theme={null}
const result = await startVerificationWithWorkflow('your-workflow-id', {
  contactDetails: {
    email: 'user@example.com',
    sendNotificationEmails: true,  // Send status update emails
    emailLang: 'en',               // Email language (ISO 639-1)
    phone: '+14155552671',         // E.164 format
  },
});
```### अपेक्षित विवरण (क्रॉस-सत्यापन)दस्तावेज़ से निकाले गए डेटा के साथ स्वचालित क्रॉस-सत्यापन के लिए उपयोगकर्ता के अपेक्षित विवरण दें:```tsx theme={null}
const result = await startVerificationWithWorkflow('your-workflow-id', {
  expectedDetails: {
    firstName: 'John',
    lastName: 'Doe',
    dateOfBirth: '1990-05-15',     // YYYY-MM-DD format
    gender: 'M',
    nationality: 'USA',            // ISO 3166-1 alpha-3
    country: 'USA',
    address: '1 Market St, San Francisco, CA',
    identificationNumber: 'A1234567',
    ipAddress: '203.0.113.42',
    portraitImage: 'https://...',  // URL or base64 reference image
  },
});
```सभी `ExpectedDetails` फ़ील्ड वैकल्पिक हैं। पूरे प्रकार के लिए [`src/types.ts`](https://github.com/didit-protocol/sdk-react-native/blob/main/src/types.ts) देखें।### कस्टम मेटाडेटासत्र के साथ कस्टम JSON मेटाडेटा संग्रहीत करें (यह उपयोगकर्ता को नहीं दिखाया जाता):```tsx theme={null}
const result = await startVerificationWithWorkflow('your-workflow-id', {
  vendorData: 'user-123',
  metadata: '{"internalId": "abc123", "source": "mobile-app"}',
});
```***## Gestión de resultadosTanto `startVerification` como `startVerificationWithWorkflow` devuelven un `Promise<VerificationResult>`. El resultado es una unión discriminada: usa el campo `type` para determinar el resultado.### Casos de resultado| Caso | Descripción |
| - | - |
| `completed` | El flujo de verificación se completó (consulta `session.status` para ver el resultado) |
| `cancelled` | El usuario canceló el flujo de verificación |
| `failed` | Se produjo un error durante la verificación |### Propiedades de SessionData| Propiedad | Tipo | Descripción |
| - | - | - |
| `sessionId` | `string` | Identificador único de la sesión |
| `status` | `VerificationStatus` | `Approved`, `Pending` o `Declined` |### Tipos de error| Error | Descripción |
| - | - |
| `sessionExpired` | La sesión ha expirado |
| `networkError` | Problema de conectividad de red |
| `cameraAccessDenied` | No se concedió el permiso de cámara |
| `notInitialized` | El SDK no está inicializado (solo Android) |
| `apiError` | La solicitud a la API falló |
| `unknown` | Otro error con mensaje |### Conexión perdidaSi el dispositivo pierde la conexión durante la verificación, el SDK muestra una pantalla de "Sin conexión a internet" en lugar de dejar un paso cargando.
Sigue comprobando la conexión en segundo plano y cierra la pantalla por sí sola en cuanto Didit vuelve a estar disponible, y el usuario continúa desde el paso en el que estaba.
La pantalla ofrece **Intentar de nuevo** y, cuando `showCloseButton` es `true` (el valor predeterminado), **Salir de la verificación**.
Al salir, la verificación termina con un resultado `failed` cuyo error es `networkError`, para que tu aplicación sepa que el usuario salió por la conexión.### Ejemplo completo de manejo de resultados```tsx theme={null}
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;
  }
}
```***## Ejemplo de extremo a extremo (sesión del backend → SDK de React Native → Webhook)La integración lista para producción: tu backend crea la sesión, tu aplicación de RN recibe el `session_token` y el SDK ejecuta el flujo. La decisión final se envía a tu backend mediante webhook; nunca confíes solo en el resultado del lado del cliente.### 1. Backend: crear la sesión```ts theme={null}
// Node.js / Express example. Run on your server. NEVER ship DIDIT_API_KEY to the device.
import express from "express";

const app = express();
app.use(express.json());

app.post("/api/verification/start", async (req, res) => {
  const response = await fetch("https://verification.didit.me/v3/session/", {
    method: "POST",
    headers: {
      "x-api-key": process.env.DIDIT_API_KEY!,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      workflow_id: process.env.DIDIT_WORKFLOW_ID,
      vendor_data: req.body.userId, // your stable user id
    }),
  });

  if (!response.ok) {
    return res.status(500).json({ error: `Didit ${response.status}` });
  }

  const { session_id, session_token } = await response.json();
  // Persist session_id <-> userId so you can match the webhook later.
  res.json({ session_id, session_token });
});
```### 2. React Native: intercambiar el token e iniciar el SDK```tsx theme={null}
import { useCallback, useState } from 'react';
import { Button, View } from 'react-native';
import {
  startVerification,
  VerificationStatus,
  type VerificationResult,
} from '@didit-protocol/sdk-react-native';

export function VerifyButton({ userId }: { userId: string }) {
  const [loading, setLoading] = useState(false);

  const onPress = useCallback(async () => {
    setLoading(true);
    try {
      const r = await fetch('https://your-backend.example.com/api/verification/start', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ userId }),
      });
      const { session_token } = await r.json();

      const result: VerificationResult = await startVerification(session_token);

      switch (result.type) {
        case 'completed':
          if (result.session.status === VerificationStatus.Approved) {
            // Optimistic UI; rely on the webhook delivered to your backend as the source of truth.
          }
          break;
        case 'cancelled':
          // User dismissed the flow
          break;
        case 'failed':
          // Show retry — result.error.type / result.error.message
          break;
      }
    } finally {
      setLoading(false);
    }
  }, [userId]);

  return (
    <View>
      <Button title={loading ? 'Starting...' : 'Verify identity'} onPress={onPress} disabled={loading} />
    </View>
  );
}
```### 3. Backend: recibir la decisión final mediante webhook```ts theme={null}
app.post("/api/webhooks/didit", express.raw({ type: "application/json" }), (req, res) => {
  // 1. Verify the X-Signature header (see Webhooks docs)
  // 2. Parse the body
  const event = JSON.parse(req.body.toString());
  if (event.webhook_type === "status.updated") {
    // event.session_id, event.status ("Approved" | "Declined" | "In Review" | ...)
    // Look up the user by session_id and update their verification state.
  }
  res.sendStatus(200);
});
```Consulta la [guía de Webhooks](https://docs.didit.me/hi/integration/webhooks.md) para más detalles sobre la verificación de la firma HMAC.***## Ejemplo completo```tsx theme={null}
import { useState, useCallback } from 'react';
import {
  Text,
  View,
  TextInput,
  TouchableOpacity,
  Alert,
  ActivityIndicator,
  SafeAreaView,
} from 'react-native';
import {
  startVerification,
  VerificationStatus,
  type VerificationResult,
} from '@didit-protocol/sdk-react-native';

export default function App() {
  const [token, setToken] = useState('');
  const [loading, setLoading] = useState(false);

  const handleVerify = useCallback(async () => {
    if (!token.trim()) {
      Alert.alert('Error', 'Please enter a session token.');
      return;
    }

    setLoading(true);
    try {
      const result = await startVerification(token.trim(), {
        loggingEnabled: true,
      });

      switch (result.type) {
        case 'completed':
          Alert.alert(
            'Verification Complete',
            `Status: ${result.session.status}\nSession: ${result.session.sessionId}`
          );
          break;
        case 'cancelled':
          Alert.alert('Cancelled', 'The user cancelled the verification.');
          break;
        case 'failed':
          Alert.alert('Failed', `${result.error.type}: ${result.error.message}`);
          break;
      }
    } catch (error) {
      Alert.alert('Error', `Unexpected error: ${error}`);
    } finally {
      setLoading(false);
    }
  }, [token]);

  return (
    <SafeAreaView style={{ flex: 1, padding: 24, justifyContent: 'center' }}>
      <TextInput
        placeholder="Enter session token..."
        value={token}
        onChangeText={setToken}
        autoCapitalize="none"
        style={{
          borderWidth: 1,
          borderColor: '#ccc',
          borderRadius: 8,
          padding: 12,
          marginBottom: 16,
        }}
      />
      <TouchableOpacity
        onPress={handleVerify}
        disabled={loading}
        style={{
          backgroundColor: '#1a1a1a',
          borderRadius: 8,
          padding: 16,
          alignItems: 'center',
          opacity: loading ? 0.6 : 1,
        }}
      >
        {loading ? (
          <ActivityIndicator color="#fff" />
        ) : (
          <Text style={{ color: '#fff', fontWeight: '600' }}>
            Start Verification
          </Text>
        )}
      </TouchableOpacity>
    </SafeAreaView>
  );
}
```***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.