> For the complete documentation index, see [llms.txt](https://valify.gitbook.io/valify-ios-sdk-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valify.gitbook.io/valify-ios-sdk-documentation/dockit/ios-native-sdk/implementation-guide.md).

# Implementation Guide

### Configurations

The SDK builder is separated into two components.

{% hint style="info" %}
Make sure that you fetched the **access token** successfully before passing it to the Builder object.
{% endhint %}

#### Required Configurations

```swift
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 - dzaNID
```

#### Optional Configurations

```swift
    .setLanguage(arabicSwitch.isOn ? "ar" : "en") // Optional: Default is "en"
    .setExtras([
                    "advanced_confidence": true,
                    "document_verification_plus": true,
                    "profession_analysis": false
                ])
    .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
    .setPrimaryColor(UIColor.red) // Optional: Set primary color
    .setLogo(.customLogo(logo: UIImage(named: "logo")!)) // Optional: Set custom logo
    .setCustomFont(_ font: UIFont)
    
```

### Configurations Breakdown

&#x20;1\. Sets the base URL used by the SDK to communicate with your backend APIs.

```kotlin
.setBaseUrl("Base Url") 
```

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

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

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

```kotlin
.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()`
* `dzaNID()`

```kotlin
.setDocumentType(VIDVDocKitDocType.passport())
```

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

Supported languages:

* `"en"` for English
* `"ar"` for Arabic
* `"fr"` for French

```kotlin
.setLanguage("en")
```

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

```kotlin
.setCollectUserInfo(true)
```

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

```kotlin
.previewCapturedImage(true)
```

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

```kotlin
.reviewData(true)
```

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

```kotlin
.manualCaptureMode(true)
```

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

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

***

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

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

***

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

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

### Start the SDK

```swift
builder.start(self, delegate: self)
```
