---
Source: https://docs.microblink.com/platform/sdk/ios/configuration
Title: Configuration
Description: Configuration options and settings for Microblink Platform iOS SDK
---

# Configuration

The iOS SDK is configured through `MicroblinkPlatformServiceSettings`, which you pass to `MicroblinkPlatformSDK`:

```swift
let consent = MicroblinkPlatformConsent(
    userId: ...,
    isProcessingStoringAllowed: ...,
    isTrainingAllowed: ...,
    isGivenOn: ...,
    note: ...
)

let serviceSettings = MicroblinkPlatformServiceSettings(
    workflowId: ...,
    url: ...,
    consent: consent,
    additionalRequestHeaders: ...
)
```

See the [quickstart](./quickstart.md) for full UIKit integration examples.

## Configuration objects

```swift
let serviceSettings = MicroblinkPlatformServiceSettings(
    workflowId: "...",                       // required
    url: "...",                              // required
    consent: MicroblinkPlatformConsent(...), // required
    additionalRequestHeaders: [...]          // optional
)

// Path overrides (optional)
serviceSettings.startTransaction = "/transaction"
serviceSettings.cancelWorkflow = "/initialize/%@/cancel"
serviceSettings.getWorkflowInfo = "/initialize/%@/info"

let sdk = MicroblinkPlatformSDK(
    serviceSettings: serviceSettings,
    delegate: self                           // required
)
```

## Required fields

You must set the following fields.
Other fields are optional and are described in the [Optional fields](#optional-fields) section.

### `workflowId`

```swift
MicroblinkPlatformServiceSettings(
    workflowId: "example123",
    ...
)
```

This is the ID of your workflow.
You can get the `workflowId` from the [Platform dashboard](../../build-workflow.md).

---

### `url`

```swift
MicroblinkPlatformServiceSettings(
    url: "https://your.proxy.server",
    ...
)
```

The `url` is the base URL of the proxy service you are hosting.
By default, the SDK appends `/transaction` to this value when creating new transactions.
If you're using [our proxy](https://github.com/MicroblinkPlatform/microblink-platform-transaction-proxy) (latest version), you don't need to change anything.

---

### `consent`

Consent is a mandatory field where you provide a **unique user identifier** and the user's consent to process their data.
You provide the consent by setting the `isProcessingStoringAllowed` flag to `true`.
If it is not set, the SDK will show its own consent form to the user.
If they reject, the transaction will be abandoned and the delegate will be called with `.consentDenied`.

:::danger[Never reuse user IDs]

Never reuse the same user ID for multiple users.
Each consent to process someone's personal data **must** be accompanied by a **unique identifier** that can be used to associate this consent with the person who gave it.

:::

```swift
MicroblinkPlatformConsent(
    // Required:
    //highlight-start
    userId: "...",
    isProcessingStoringAllowed: true,
    isTrainingAllowed: true,
    isGivenOn: .now,
    //highlight-end
    // Optional:
    note: nil
)
```

- `isTrainingAllowed`: set to `true` to allow the user's data to be used for training machine learning models; defaults to `false`.
- `isGivenOn`: the `Date` when consent was given.
- `note`: an optional note describing the consent.

---

## Optional fields

### `additionalRequestHeaders`

```swift
MicroblinkPlatformServiceSettings(
    ...
    additionalRequestHeaders: [
        "X-custom-header": "some-custom-value"
    ]
)
```

Additional HTTP headers included in every request to the proxy service.
Useful for authorization or other custom headers your proxy requires.

---

### Path overrides

```swift
var serviceSettings = MicroblinkPlatformServiceSettings(...)
serviceSettings.startTransaction = "/transaction"
serviceSettings.cancelWorkflow = "/initialize/%@/cancel"
serviceSettings.getWorkflowInfo = "/initialize/%@/info"
```

The overrides depend on how you have configured your [proxy](../../proxy.md) service.
By default, the SDK will append "/transaction" to the value in `url` when creating new transactions.
If you're using [our proxy](https://github.com/MicroblinkPlatform/microblink-platform-transaction-proxy) (latest version), you don't need to change anything.

---

### `delegate`

```swift
MicroblinkPlatformSDK(
    serviceSettings: serviceSettings,
    delegate: self
)
```

The delegate receives SDK lifecycle events.
Implement `MicroblinkPlatformSDKDelegate` on the object you pass here.
See [Delegate methods](#delegate-methods) below for details on each callback.

---

### Customization

```swift
// Primary color
MicroblinkPlatformTheme.shared.primaryColor = myColor

// Images
MicroblinkPlatformTheme.shared.mainScreenMainImage = myHomeImage
MicroblinkPlatformTheme.shared.verifySuccessImage = mySuccessImage
MicroblinkPlatformTheme.shared.verifyReviewImage = myReviewImage
MicroblinkPlatformTheme.shared.verifyErrorImage = myErrorImage
MicroblinkPlatformTheme.shared.cameraPermissionIcon = myCameraIcon

// Fonts
MicroblinkPlatformTheme.shared.mainScreenTitleFont = myTitleFont
MicroblinkPlatformTheme.shared.mainScreenSubtitleFont = mySubtitleFont
MicroblinkPlatformTheme.shared.mainButtonFont = myButtonFont
MicroblinkPlatformTheme.shared.verifyTitleFont = myVerifyTitleFont
MicroblinkPlatformTheme.shared.verifySubtitleFont = myVerifySubtitleFont

// Shape
MicroblinkPlatformTheme.shared.buttonCornerRadius = 24
```

Customizations include:

- `primaryColor`: controls the primary color of buttons and interactive elements throughout the SDK.
- Images (`mainScreenMainImage`, `verifySuccessImage`, `verifyReviewImage`, `verifyErrorImage`, `cameraPermissionIcon`): replace the default images on the home, result, and camera permission screens.
- Fonts: individual `UIFont` properties for each screen element: title, subtitle, button, loading, error, and camera permission screens.
- `buttonCornerRadius`: controls the corner radius of action buttons; defaults to `10`.
- `documentScan*` properties: `Color` and `Font` values controlling the appearance of alert dialogs, onboarding sheets, and the scanning reticle within document capture screens.

Read more about [how to customize your iOS SDK integration](./customization.md).

---

## Delegate methods

### Transaction finished

```swift
func microblinkPlatformSDKDidFinish(
    viewController: UIViewController,
    result: MicroblinkPlatformResult
) {
    viewController.dismiss(animated: true)
}
```

Called when the transaction finishes.
`MicroblinkPlatformResult` contains:

- `status`: a `MicroblinkPlatformResultStatus` value: `.accept`, `.review`, or `.reject`
- `transactionId`: the unique identifier of the completed transaction

### User exited

```swift
func microblinkPlatformSDKDidClose(
    viewController: UIViewController,
    cancelState: MicroblinkPlatformCancelState
) {
    viewController.dismiss(animated: true)
}
```

Called when the user exits the workflow before completion.
`MicroblinkPlatformCancelState` contains:

- `cancelReason`: a `MicroblinkPlatformCancelReason` value: `.userCanceled` or `.consentDenied`
- `transactionId`: the transaction ID, if available at the time of cancellation

### Card scan step finished

```swift
func microblinkPlatformSDKDidFinishCardScanStep(
    viewController: UIViewController,
    cardScanResult: MicroblinkPlatformResultCardScanResult
) {
    // cardScanResult.cardNumber, .expiryDate, .owner, .cvv
}
```

Called when a card scan step is completed within the flow.
`MicroblinkPlatformResultCardScanResult` contains `cardNumber`, `expiryDate`, `owner`, and `cvv`.


Last updated on Jun 18, 2026
