Configuration
| Property | Type | Required | Description |
|---|---|---|---|
mode | WorkingMode | No | Defines the working mode of the SDK. Can be classic or d2d. Defaults to classic. |
apiConfig | ProxyConfig | TransactionConfig | Yes | Configuration options for communication with the Microblink Platform API. |
themeOverride | ThemeOverride | No | Options to override the default look and feel of the SDK. |
translationsOverride | TranslationMessages | No | Options to override the default English text in the app. |
consentData | ConsentData | Yes | Data indicating user choices for storing and processing personal data. |
resourcesPath | string | No | Path to the resources folder containing the WebAssembly (WASM) resources. |
enableD2D | boolean | No | Flag to enable or disable device-to-device feature. Defaults to false. |
onExit | (status: 'completed' | 'aborted') => void | No | Deprecated. Callback triggered when the workflow is completed or aborted. Use onTransactionFinished and onAbort instead. |
onTransactionFinished | (result: FinishResult) => void | No | Callback triggered when the transaction is finished. Provides the transaction status and ID. |
onAbort | () => void | No | Callback triggered when the user exits the workflow before completion. |
target | HTMLElement | No | This property is only applicable for the Vanilla version. It defines the target element in the DOM where the IDV flow will be rendered |
For Vanilla version, target can be defined to control where in the DOM the content will be placed.
Defining communication with proxy service
To use the SDK, you need to configure the apiConfig property, which defines how the SDK communicates with the Microblink Platform. Depending on your use case, you can use either a ProxyConfig or a TransactionConfig object.
ProxyConfig
The ProxyConfig object is used when starting a new transaction via a proxy service. It includes the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
workflowId | string | Yes | The ID of the workflow to be executed. Workflow defines which steps will be executed. |
url | string | Yes | The URL of the proxy server. |
headers | Record<string, string> | No | Additional HTTP headers to include in the request. |
formValues | Record<string, string> | No | Custom fields sent to the proxy server when starting the transaction. These fields may be required depending on the workflow configuration. |
d2d | D2DConfig | No | Configuration options for device-to-device communication. Includes properties like joinKey (optional) and runAddress (required). |
TransactionConfig
The TransactionConfig object is used when resuming or starting a flow with an existing transaction ID. This is useful for scenarios like device-to-device flows or verification links. It includes the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
apiUrl | string | Yes | The URL used to communicate with the Microblink Platform API. |
transactionId | string | Yes | The transaction ID to be used in the IDV flow. |
ephemeralKey | string | Yes | The key used for secure communication with the API. |
d2d | D2DConfig | No | Configuration options for device-to-device communication. Includes properties like joinKey and runAddress. |
You can choose the appropriate configuration object based on your integration needs and pass it to the apiConfig property of the SDK.
Consent Data
The consentData property is used to define user choices related to the storage and processing of their personal data during the identity verification process. This is essential for ensuring compliance with data protection regulations. The ConsentData object includes the following properties:
| Property | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | The user ID associated with the consent. |
note | string | Yes | The text of the consent provided by the user. |
givenOn | string | Yes | The date and time when the consent was given. |
isProcessingStoringAllowed | boolean | Yes | Indicates whether the user has allowed the storage of processed data. |
isTrainingAllowed | boolean | Yes | Indicates whether the user has allowed their data to be used for training machine learning models. |
This object should be passed to the SDK as the consentData property to ensure proper handling of user consent during the verification process.
Transaction result
The result of the transaction is passed to the onTransactionFinished callback. The FinishResult object, which is passed to the onTransactionFinished callback, contains the following properties:
| Property | Type | Description |
|---|---|---|
status | VerificationStatus | The status of the transaction. Possible values include Unknown, Accept, Reject, and Review. |
transactionId | string | The unique identifier of the transaction. |
This object provides essential information about the outcome of the transaction, allowing you to handle the result appropriately in your application.