iOS SDK
A native drop-in for document capture, face match and liveness. Distributed as a prebuilt XCFramework with no transitive dependencies, it supports both SwiftUI and UIKit and presents the flow full-screen, returning a typed decision.
Requirements
- iOS 15.0+, Xcode 15+, Swift 5.9+
- SwiftUI or UIKit
- A real device for camera and liveness (the simulator camera is static)
Install
Swift Package Manager (recommended):
// Package.swift dependencies: [ .package(url: "https://github.com/Othento/ios-sdk", from: "0.1.0"), ] // In Xcode: File → Add Package Dependencies… // and enter https://github.com/Othento/ios-sdk
CocoaPods:
# Podfile pod 'Othento', '~> 0.1.0'
Camera permission
Add a usage description to your Info.plist — the SDK requests camera access at first capture:
<key>NSCameraUsageDescription</key> <string>Camera access is required to scan your ID and selfie.</string>
SwiftUI
The simplest integration is the .othentoVerification(isPresented:config:onResult:) view modifier. Build a config once, then present and handle one OthentoResult:
import Othento
import SwiftUI
struct VerifyView: View {
@State private var show = false
let config = try! OthentoConfig.Builder()
.create(workflowExternalId: "wf_onboarding", clientData: "user-123")
.apiKey("pk_sandbox_•••")
.build()
var body: some View {
Button("Verify identity") { show = true }
.othentoVerification(isPresented: $show, config: config) { result in
switch result {
case let .completed(decision, externalId): print(decision, externalId)
case let .cancelled(reason): print(reason)
case let .failed(error, message): print(error.code, message)
}
}
}
}UIKit
Construct OthentoSDK with a listener, present its viewController(), then call start():
let config = try OthentoConfig.Builder()
.create(workflowExternalId: "wf_onboarding", clientData: "user-123")
.apiKey("pk_sandbox_•••")
.build()
let sdk = OthentoSDK(config: config, listener: self)
present(sdk.viewController(), animated: true)
sdk.start()
// MARK: - OthentoSDKListener
extension MyViewController: OthentoSDKListener {
func onCompleted(decision: OthentoDecision, externalId: String) {}
func onCancelled(reason: OthentoCancelReason) {}
func onError(_ error: OthentoError, displayMessage: String) {}
func onReady() {}
func onSessionCreated(externalId: String, sessionUrl: String) {}
func onStatusChanged(_ status: OthentoSessionStatus) {}
}Configuration & lifecycle
OthentoConfig.Builder validates synchronously — build() throws an OthentoConfigError if a required field is missing. The required create-mode inputs are workflowExternalId, clientData and apiKey; optional builder methods include expectedDetails, callbackUrl, callbackReceiver and metadata. For production, use tokenMode(sat:) to keep keys off the device.
The OthentoSDKListener protocol delivers onReady, onSessionCreated, onStatusChanged and exactly one terminal callback — onCompleted, onCancelled or onError. All callbacks run on the main actor. See the API reference for every option, enum and error code.