Skip to main content

Configuration

PropertyTypeRequiredDescription
modeWorkingModeNoDefines the working mode of the SDK. Can be classic or d2d. Defaults to classic.
apiConfigProxyConfig | TransactionConfigYesConfiguration options for communication with the Microblink Platform API.
themeOverrideThemeOverrideNoOptions to override the default look and feel of the SDK.
translationsOverrideTranslationMessagesNoOptions to override the default English text in the app.
consentDataConsentDataYesData indicating user choices for storing and processing personal data.
resourcesPathstringNoPath to the resources folder containing the WebAssembly (WASM) resources.
enableD2DbooleanNoFlag to enable or disable device-to-device feature. Defaults to false.
onExit(status: 'completed' | 'aborted') => voidNoDeprecated. Callback triggered when the workflow is completed or aborted. Use onTransactionFinished and onAbort instead.
onTransactionFinished(result: FinishResult) => voidNoCallback triggered when the transaction is finished. Provides the transaction status and ID.
onAbort() => voidNoCallback triggered when the user exits the workflow before completion.
targetHTMLElementNoThis 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:

PropertyTypeRequiredDescription
workflowIdstringYesThe ID of the workflow to be executed. Workflow defines which steps will be executed.
urlstringYesThe URL of the proxy server.
headersRecord<string, string>NoAdditional HTTP headers to include in the request.
formValuesRecord<string, string>NoCustom fields sent to the proxy server when starting the transaction. These fields may be required depending on the workflow configuration.
d2dD2DConfigNoConfiguration 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:

PropertyTypeRequiredDescription
apiUrlstringYesThe URL used to communicate with the Microblink Platform API.
transactionIdstringYesThe transaction ID to be used in the IDV flow.
ephemeralKeystringYesThe key used for secure communication with the API.
d2dD2DConfigNoConfiguration 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.

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:

PropertyTypeRequiredDescription
userIdstringYesThe user ID associated with the consent.
notestringYesThe text of the consent provided by the user.
givenOnstringYesThe date and time when the consent was given.
isProcessingStoringAllowedbooleanYesIndicates whether the user has allowed the storage of processed data.
isTrainingAllowedbooleanYesIndicates 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:

PropertyTypeDescription
statusVerificationStatusThe status of the transaction. Possible values include Unknown, Accept, Reject, and Review.
transactionIdstringThe 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.