Implementation Guide

Configurations

The SDK builder is separated into two components.

Make sure that you fetched the access token successfully before passing it to the Builder object.

Required Configurations

var builder = VIDVDocBuilder()
    .setBaseURL(creds.baseURL) // Required: SDK endpoint
    .setAccessToken(accessToken) // Required: OAuth token
    .setBundleKey(creds.bundle) // Required: Provided bundle key
    .setDocumentType(.<your chosen documnet>) // Required: available doc types: passport - egyNID - tunNID

Optional Configurations

    .setLanguage(arabicSwitch.isOn ? "ar" : "en") // Optional: Default is "en"
    .setCollectUserInfo(true) //  Optional: Default is false
    .setManualCapture(manualCaptureSwitch.isOn) // Optional: Enable manual mode
    .setPreviewCapturedImage(previewCapturedImageSwitch.isOn) // Optional: Show image preview
    .setReviewData(previewResultsSwitch.isOn) // Optional: Show review screen
    .setHeaders([String:String]) // Optional: Default is no custom headers
if customColorSwitch.isOn {
    builder.setPrimaryColor(UIColor.red) // Optional: Set primary color
}


if customLogoSwitch.isOn {
    builder.setLogo(.customLogo(logo: UIImage(named: "logo")!)) // Optional: Set custom logo
}

Configurations Breakdown

1. Sets the base URL used by the SDK to communicate with your backend APIs.

.setBaseUrl("Base Url") 

2. Sets the access token required for authenticating SDK API requests.

.setAccessToken("Access Token") // add the fetched access token here

3. Associates the session with your account using a unique bundle key.

.setBundleKey("Bundle Key") // add your actual bundle key

4. Specifies the type of document to be captured by the SDK.

Available options:

  • passport

  • egyNID()

  • tunNID()

.setDocumentType(VIDVDocKitDocType.passport())

5. Sets the interface language used throughout the SDK experience.

Supported languages:

  • "en" for English

  • "ar" for Arabic

.setLanguage("en")

6. Enables the collection of user info like location. Requires location permission in manifest.

.setCollectUserInfo(true)

7. Enables image preview after capture so users can confirm or retake it.

.previewCapturedImage(true)

8. Displays a data review screen before submitting the final result.

.reviewData(true)

9. Enables manual capture mode for users instead of automatic capture.

.manualCaptureMode(true)

10. Allows you to send custom headers along with every API request made by the SDK.

.setHeaders(["custom-header": "value"]) // Optional: Default is no custom headers

11. Sets the SDK’s primary color to match your brand.

.setPrimaryColor(UIColor.red) // Optional: Set primary color

12. Sets a custom logo to be displayed in the SDK interface.

.setLogo(.customLogo(logo: UIImage(named: "logo")!)) // Optional: Set c

Start the SDK

builder.start(self, delegate: self)

Last updated