SDK Customization
This section covers how developers can customize the KYC SDK's built-in UI, control screen visibility, set the document type, customize tutorial screens, configure localization, and handle errors.
UI Configuration
The VIDAKYCUIConfig class allows comprehensive UI customization:
let uiConfig = VIDAKYCUIConfig(
showTutorial: true,
showConsentScreen: true,
showDocumentSelection: true,
hidePassportOption: false,
hideBrandLogo: false,
primaryButtonBgColor: UIColor.systemGreen,
primaryButtonTextColor: UIColor.white,
primaryButtonCornerRadius: 8.0,
headerBgColor: UIColor.systemBackground,
headerTextColor: UIColor.label,
headerIconsTintColor: UIColor.label,
cameraOverlayOpacity: 1.0,
cameraOverlayBgColor: UIColor.black,
cameraOverlayBlurStyle: .systemMaterialDark,
cameraOverlayProgressBgColor: UIColor.gray,
cameraOverlayProgressColor: UIColor.systemGreen,
fontProvider: myCustomFontProvider(), // VIDAKYCFontProvider?
customBrandLogo: myBrandLogoProvider() // UIImage?
)Configuration Options
showTutorial
Enable or disable the Document OCR tutorial page. This does not affect the Liveness tutorial. To disable the Liveness tutorial independently, return nil from createLivenessTutorialPage in your VIDAKYCViewFactory implementation.
showConsentScreen
Enable or disable the consent screen.
showDocumentSelection
Enable/disable document selection page. This only controls whether the page is shown. It does not set which document type the SDK captures - see Setting the Document Type.
hidePassportOption
Disable passport option in selection
hideBrandLogo
Hide the VIDA brand logo.
primaryButtonBgColor
Primary button background color
primaryButtonTextColor
Primary button text color
primaryButtonCornerRadius
Corner radius of primary button
headerBgColor
Header navigation background color
headerTextColor
Header title text color
headerIconsTintColor
Header icons tint color
cameraOverlayOpacity
Opacity of camera overlay
cameraOverlayBgColor
Camera overlay background color
cameraOverlayBlurStyle
Blur style for camera overlay
cameraOverlayProgressBgColor
Progress view background color
cameraOverlayProgressColor
Progress view color
fontProvider
Customers can use VIDAKYCFontProvider to inject custom fonts for all texts within the SDK.
customBrandLogo
Provide a custom brand logo image (UIImage).
Color Customization
You can customize colors to match your app's branding:
Setting the Document Type
Use the defaultDocumentType parameter during SDK initialization to explicitly set which document type the SDK should capture. This is especially useful when you hide the built-in document selection page and want to control the document type programmatically.
How to Set the Document Type
Pass defaultDocumentType when calling vidaKYC.initialize():
Supported Values
defaultDocumentType supports the following values:
.KTP
Indonesian national ID card
Malaysian Cards (.myKAD,.myKAS,.myPR, .myTentera)
Malaysia Identity Card
.passport
Passport
.DL
Driver's License
Default behaviour
If defaultDocumentType is not set, the SDK uses the default document type for the flow:
Indonesia
KTP
Malaysia
myKAD
Usage with Hidden Selection Page
When you hide the built-in selection page using showDocumentSelection: false in VIDAKYCUIConfig, you should explicitly set defaultDocumentType during initialization. If you hide the selection page without setting defaultDocumentType, the SDK falls back to the default document type for the region.
Custom Tutorial Screens
You can customize the tutorial screens by using VIDAKYCViewFactory. The factory protocol provides two optional functions to provide view controllers for tutorial pages for document capture and liveness. Make sure to call the corresponding action delegate functions within the view controllers to manage the flow.
Localization
The SDK includes built-in support for the following languages:
English (en) - Default
Indonesian (id)
To use a supported language, pass the ISO 639-1 language code when initializing:
Adding Custom Languages
To add support for additional languages not included in the SDK:
Add a Localizable.strings file to your app for the desired language
Provide translations for all SDK string keys (refer to the SDK's localization keys)
Pass the language code when initializing
The SDK will use your app's localized strings for any languages you provide translations for.
Error Configuration
The VIDAKYCErrorConfig class manages error handling and retry logic:
Support Configuration
VIDAKYCErrorSupportType
Last updated
