GitHub Repository
View source code, releases, and the complete changelog on GitHub
Native SDK: This is the recommended approach for iOS apps. Native SDKs provide the best user experience, optimized camera handling, and full NFC support.
Requirements
iOS Version Compatibility
Installation
The SDK ships in two flavors:
Pick Full if your workflow scans the NFC chip on passports/eIDs. Pick Core if you only need document + face + liveness and want to avoid the NFC binary, CoreNFC runtime, and the App Store NFC demo-video review request.
Swift Package Manager (Recommended)
Add the package to your project using Xcode:- Go to File > Add Package Dependencies
- Enter the repository URL:
- Select the version (or Up to Next Major from
3.6.0) and click Add Package - When prompted to choose a product, pick
DiditSDK(Full, NFC) orDiditSDKCore(no NFC)
Package.swift:
CocoaPods
DiditSDK is distributed as a binary podspec hosted in the repo (it is not on the public CocoaPods Trunk), so you must reference the podspec URL.
Full SDK (with NFC, iOS 15.0+):
After
pod install, open the generated .xcworkspace (not .xcodeproj).Xcode 15+ rsync errors: If you see
Operation not permitted rsync errors during build, set Build Settings → User Script Sandboxing (ENABLE_USER_SCRIPT_SANDBOXING) to No on the project for both Debug and Release.Manual (XCFramework)
Download the frameworks from the GitHub Releases page, then drag the.xcframework folders into Xcode and set Embed & Sign.
- Full SDK:
DiditSDK.xcframework.zip+OpenSSL.xcframework.zip - Core SDK:
DiditSDK-Core.xcframework.zip
Permissions
The SDK requires the following permissions. Add these to your app’sInfo.plist:
Example Info.plist Entries
NFC Configuration
Required only when installing the Full SDK. Skip this section if you installedDiditSDK/Core (CocoaPods) or DiditSDKCore (SwiftPM).
To enable NFC reading for passports and ID cards with chips:
-
Add NFC Capability in Xcode:
- Select your target → Signing & Capabilities → + Capability → Near Field Communication Tag Reading
-
Add ISO7816 Identifiers to
Info.plist:
- Add Entitlements (in your
.entitlementsfile):
App Store Review (Full SDK only): If you install the Full SDK, Apple may request a demo video during review because NFC-related code is part of the SDK binary — even if your workflow does not use NFC. Download our NFC demo video to submit to Apple: Download NFC Demo Video. This does not apply to the Core SDK.
Quick Start
SwiftUI Integration
UIKit Integration
Integration Methods
The SDK supports two integration methods:Method 1: UniLink (Simplest)
No backend required. The SDK creates the session directly using your workflow ID from the Didit Console. The UniLink method (startVerification(workflowId:)) only supports vendorData; for any other session parameters use Method 2.
For
vendorData to be attached to the session via UniLink, enable the Vendor Data option in the Didit Console.Method 2: Backend Session (Recommended for Production)
Your backend creates the session via the Create Verification Session API (POST /v3/session/) with full parameter support (contact_details, expected_details, metadata, callback, etc.), then passes the session_token to the SDK.
- Associating sessions with your users (
vendor_data) - Setting contact details and expected details for cross-validation
- Setting custom metadata
- Configuring callbacks per session This data (contact details, expected details, metadata, callback) is sent to the Create Verification Session API.
Configuration
Customize the SDK behavior withDiditSdk.Configuration:
Configuration Options
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.
Options
showCloseButton, showExitConfirmation, and closeOnComplete match the Web SDK’s DiditSdkConfiguration. Mobile-specific options languageLocale and fontFamily exist because the mobile SDK renders the full verification UI natively (unlike the Web SDK which delegates to the hosted frontend inside an iframe).Language Support
The SDK supports 53 languages. If no language is specified, the SDK uses the device locale with English as fallback.Advanced Session Parameters
For advanced session parameters (contact_details, expected_details, metadata, callback), use the Backend Session method. Your backend calls the Create Verification Session API with full parameters, then passes the session_token to the SDK.
Handling Results
TheVerificationResult enum provides the outcome of the verification:
Result Cases
SessionData Properties
Error Types
Complete Result Handling Example
Dismissing the Verification Programmatically
Available in DiditSDK 3.6.0+.
DiditSdk.shared.dismiss(). This is the recommended way to tear down the verification when the host needs to take over the screen — for example, when the app moves to the background.
dismiss() goes through the SDK’s normal completion pipeline: it dismisses the presented UI, resets internal state, and invokes the .diditVerification handler with .cancelled(session:) carrying the current sessionId if a session was created. It is a no-op when no verification is active.
Example: dismiss when the app backgrounds
Observing SDK State
You can observe the SDK state for custom loading UI:End-to-End Example (Backend Session → iOS SDK → Result)
This pattern is the production-ready integration. Your backend creates the session, your iOS app receives thesession_token, and the SDK runs the flow.