Skip to main content
A cross-platform React Native SDK that wraps the native iOS and Android SDKs, providing a unified TypeScript API for identity verification.

GitHub Repository

View source code and examples on GitHub

npm Package

@didit-protocol/sdk-react-native

Requirements

Platform Requirements

Biometric consent needs native 4.10.0 or later. For people covered by Illinois, Texas or Colorado law, Didit can ask for explicit biometric consent before the first face capture. A React Native SDK release that pins native iOS and Android 4.10.0 or later shows that step. Earlier versions cannot show the step: their sessions run as before, and the decision reports the consent as not collected (biometric_consent.reason: "BIOMETRIC_CONSENT_UNSUPPORTED_SDK"). Upgrade if you verify people in those states.

Installation

Then add the config plugin to your app.json (or app.config.js). NFC is enabled by default:
The plugin automatically configures both platforms:
  • Android: Adds the Didit Maven repository to Gradle, sets the diditSdkAndroidNfcEnabled Gradle property, and applies BouncyCastle dependency/packaging rules
  • iOS: Adds the DiditSDK podspec to the Podfile (pinned to iOS 15 when NFC is enabled)
The plugin does not edit Info.plist. Add the iOS permission keys and, for NFC, the ISO7816 select identifiers under ios.infoPlist in the same file. D392F000260100000001 lets the SDK read the Japan My Number Card through JPKI:

Disabling NFC dependencies

To build without NFC support (smaller binary, no NFC capability required), pass plugin options:
When NFC is disabled, you do not need the iOS NFC capability, NFC entitlements, or NFC-related provisioning setup.
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.

React Native CLI

iOS Setup

Add the DiditSDK pod to your Podfile (it’s not on CocoaPods trunk). The block below honours an DIDIT_SDK_IOS_NFC_ENABLED environment variable so you can toggle the no-NFC subspec (DiditSDK/Core) at install time:
The tag in the podspec URL must match diditNativeSdkVersions.ios in the installed package version. React Native 4.15.2 pins native iOS 4.15.1 and native Android 4.15.1. Do not point the podspec at main: the package depends on that exact native iOS version, so as soon as main moves ahead CocoaPods sees two incompatible requirements for DiditSDK and every pod install fails. The Expo config plugin derives this URL for you; only the bare React Native CLI path needs it written out by hand.
Then install dependencies:
To rebuild without NFC dependencies, clean CocoaPods and re-run with the env var set:

Android Setup

From 4.15.2 the package adds Didit’s Maven repository (the me.didit group only) to your build itself, and Android needs no Gradle change. On 4.15.1, add the repository to every project in android/build.gradle:
React Native’s Gradle plugin declares repositories on every project, so Gradle ignores repositories an app lists in settings.gradle and the build fails with Could not find me.didit:didit-sdk. If your settings.gradle sets repositoriesMode to PREFER_SETTINGS, list the repository there instead. The SDK’s wallet dependencies come from JitPack, which React Native’s Gradle plugin already adds. Add the following to your app’s android/app/build.gradle (inside the android { ... } block) to resolve BouncyCastle duplicate-class conflicts and the OSGI MANIFEST.MF duplicate that the DiditSDK transitive dependencies can trigger:
To build without Android NFC dependencies (uses the me.didit:didit-sdk-core artifact instead of me.didit:didit-sdk), add this to android/gradle.properties:
Remove that property, or set it to true, to use the full Android SDK with NFC.

Permissions

iOS

Add the following keys to your app’s Info.plist. Missing required iOS privacy keys will cause iOS to terminate the app as soon as the SDK accesses that protected resource.

NFC Configuration

To enable NFC reading for passports and ID cards with chips:
  1. Add NFC Capability in Xcode:
    • Select your target > Signing & Capabilities > + Capability > Near Field Communication Tag Reading
  2. Add ISO7816 Identifiers to Info.plist:
D392F000260100000001 lets the SDK read the Japan My Number Card through JPKI: without it, iOS does not report the card to the SDK. My Number Card reading is not enabled in production yet, and the identifier changes nothing for other documents, so you can add it now.
  1. Add an entitlements file with NFC tag reading enabled:
Make sure the app’s provisioning profile includes the NFC Tag Reading capability. This NFC configuration is not needed when NFC is disabled.

Android

The following permissions are declared in the SDK’s AndroidManifest.xml and merged automatically: Camera and NFC hardware features are declared as optional (android:required="false"), so your app can be installed on devices without these features.

Quick Start


Integration Methods

The SDK supports two integration methods: Create a session on your backend using the Create Verification Session API, then pass the token to the SDK:
This approach gives you full control over:
  • Associating sessions with your users (vendor_data)
  • Setting custom metadata
  • Configuring callbacks per session

Method 2: Workflow ID (Simpler Integration)

For simpler integrations, the SDK can create sessions directly using your workflow ID:

Configuration

Customize the SDK behavior by passing a DiditConfig object:
For startVerificationWithWorkflow, pass config inside options.config:

Configuration Options

Camera options

The camera options match the Web SDK camera options. Each lens is CameraLens.Front or CameraLens.Back. If the device does not have the requested lens, the SDK uses the first camera it has. The camera switcher is also hidden on devices that have only one camera. Set a switcher option to false to lock the user to the default lens of that step.
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.

Language Support

The SDK supports 54 languages. If no language is specified, the SDK uses the device locale with English as fallback.
View All Supported Languages →

Advanced Options

These options are only available with startVerificationWithWorkflow, where the SDK creates the session on your behalf.

Contact Details (Prefill & Notifications)

Provide contact details to prefill verification forms and enable email notifications:

Expected Details (Cross-Validation)

Provide expected user details for automatic cross-validation with extracted document data:
All ExpectedDetails fields are optional. See src/types.ts for the full type.

Custom Metadata

Store custom JSON metadata with the session (not displayed to user):

Handling Results

Both startVerification and startVerificationWithWorkflow return a Promise<VerificationResult>. The result is a discriminated union — use the type field to determine the outcome.

Result Cases

SessionData Properties

Error Types

Lost connection

If the device loses its connection during the verification, the SDK covers the flow with a “No internet connection” screen instead of leaving a step loading. It keeps checking in the background and closes the screen by itself as soon as Didit can be reached again, and the user carries on from the step they were on. The screen offers Try Again and, when showCloseButton is true (the default), Exit Verification. Exiting ends the verification with a failed result whose error is networkError, so your app knows the user left because of the connection.

Complete Result Handling Example


End-to-End Example (Backend Session → React Native SDK → Webhook)

The production-ready integration: your backend creates the session, your RN app receives the session_token, and the SDK runs the flow. The final decision is delivered to your backend via webhook — never trust the client-side result alone.

1. Backend — create the session

2. React Native — exchange and start the SDK

3. Backend — receive the final decision via webhook

See the Webhooks guide for HMAC signature verification details.

Complete Example


Last modified on November 12, 2026