Integration
This section explains the core integration flow of the VIDA KYC SDK within an iOS application. Each step ensures the correct initialization, execution, and cleanup of the SDK lifecycle.
Import VIDA KYC
Import the VIDAKYC framework in your view controller or wherever you need to use it and acts as the entry point for all operations.
import vidaKYCCreate VIDA KYC Instance
The VIDAKYC instance serves as the entry point for all KYC operations — initialization, starting and stopping the verification process, and releasing resources.
let vidaKYC = VIDAKYC()Initialize VIDA KYC
vidaKYC.initialize(
kycConfig: kycConfig,
presentNavigationController: navigationController,
languageCode: "en" // Optional: ISO 639-1 language code
)This method prepares the SDK for the KYC flow by:
Verifying SDK configuration and network readiness
Establishing internal resources such as camera and backend connections
Triggering the onInitialized() callback once the setup is complete
Important: You must call this method before any other KYC operation. If initialization fails, the SDK notifies the host application through the onError() callback.
Start KYC Detection
The startFlow() method begins the KYC capture and verification flow, launching the SDK camera interface and guiding users through:
Document scanning (e.g., KTP, MyKAD, Passport, or other ID types)
Face capture and matching (if required by the selected flow)
It handles frame processing, OCR extraction, liveness checks, and backend verification automatically. When the flow completes successfully, the SDK invokes onSuccess(response:) on the delegate.
Stop KYC Detection
This method allows the host app to manually stop the KYC process before it finishes, typically in cases where:
The user cancels the process
An external condition (like network loss) requires halting detection
The SDK gracefully stops all camera operations and releases partial resources.
Release Resources
Releasing resources is essential after completing or canceling the flow. It ensures all camera sessions, background threads, and temporary memory allocations used by the SDK are properly disposed of.
Best Practice: Always invoke releaseSDK() in your view controller's cleanup methods or after a completed session to prevent memory leaks or background processing issues.
VIDAKYCDelegate Implementation
The VIDAKYCDelegate protocol enables the host application to respond to SDK lifecycle events:
onInitialized()
Called when the SDK is successfully initialized and ready to start KYC operations. You should only call startFlow() after this callback.
onSuccess(response: VIDAKYCResponse)
Triggered upon successful completion of the KYC flow. The VIDAKYCResponse contains results of all backend and OCR verifications, including scores and metadata.
onError(errorCode: Int, errorMessage: String, response: VIDAKYCResponse)
Called when an error occurs during initialization or the KYC process. The response object may include diagnostic data if available.
VIDAKYCConfig
The VIDAKYCConfig class defines the configuration and authentication parameters for the KYC process.
Parameters
token
String
Token to be used for authentication
keys
VIDAKYCKeys
Contains required keys for configuring liveness AND/OR fraudshield within sdk
livenessConfig
VIDALivenessConfig?
Configuration for liveness SDK (optional, required for liveness flows)
flow
VIDAKYCFlow
Flow type: .kyc, or .idVerification
delegate
VIDAKYCDelegate
Delegate for callbacks
errorConfiguration
VIDAKYCErrorConfig
Error page configuration
uiConfiguration
VIDAKYCUIConfig
UI customization configuration
viewFactory
VIDAKYCViewFactory
A factory protocol to inject custom tutorial screens in SDK
defaultDocumentType
VIDAKYCDocumentType
Default document type if selection is disabled
sdkRegion
VIDAKYCSDKRegion
Region: .indonesia or .malaysia
passportCountryCode
String?
ISO 3166-1 alpha-3 code for passport scanning
enableDocAutoCapture
Bool
Enables/Disables autocapture throughout doc capture flows. Default is true
captureAdditionalImageWithFlash
Bool
If enabled captures 2 images, normal and with flash for material check
docAutoCaptureMinimumStableFrames
Int
Minimum valid frames for auto capture
docCaptureTimeout
TimeInterval
Max time for each capture
autoCapturePauseTimeout
TimeInterval
Max time at which if autocapture enabled, switching to manual pop up is shown
luminanceThreshold
Float
Threshold value to identify whether the image is dark or not. Range (0-1). default value is 0.23
VIDAKYCKeys
VIDAKYCFlow
Detailed Configuration Guide:
For comprehensive documentation on configuring the VIDA Liveness SDK, including all available parameters, UI customization options, and best practices, please refer to:
VIDA iOS SDK FraudShield/Liveness Configuration:
Add shared activation key in the application’s Info.plist under vida_activation_key
Configure the sdk with parameters within the
VIDALivenessConfig
Note: - For additional configuration details, checkout the liveness sdk integration guide - https://docs.vida.id/vida-identity-platform/integration-methods/sdk/ios-sdk
VIDAKYCDocumentType
SDK currently supports the following documents:
KTP
Indonesian National ID
DL
Driving License
myKAD
Malaysian ID Card
myKAS
Malaysian temporary resident identification card
myPR
Malaysian Permanent Resident ID Card
myTentera
Malaysian Military ID Card
Passport
VIDAKYCSDKRegion
VIDAKYCResponse
The VIDAKYCResponse class encapsulates the results of the entire KYC verification process.
The response serves as the final structured output from the VIDA SDK, passed via the onSuccess() or onError() callbacks in VIDAKYCDelegate. failedOperation will have ocrFront/ocrBack/liveness/faceMatch as the options.
Framework Version
To get the current framework version:
Last updated
