Skip to main content

types

Microblink Platform SDK


Microblink Platform SDK / types

types

Interfaces

ConsentData

This interface defines the data which indicates user choices related to storing and processing of their data gathered in the transaction.

Properties

givenOn

givenOn: string

The date and time when the consent was given.

isProcessingStoringAllowed

isProcessingStoringAllowed: boolean

Whether user gave consent to store processed data

isTrainingAllowed

isTrainingAllowed: boolean

Whether user gave consent to use it's data in models training

note

note: string

The text of the consent that the user is providing.

userId

userId: string

The user ID that will be associated with the consent.


D2DConfig

Properties

joinKey?

optional joinKey: string

runAddress

runAddress: string


DocumentScanningSettings

Properties

onTimeout()?

optional onTimeout: (error) => void

Callback function which will be triggered when the scanning process hits the timeout duration.

Parameters
ParameterType
errorany
Returns

void

timeout?

optional timeout: number

Timeout duration for the scanning process. If the scanning process takes hits the timeout duration, the scanning will be aborted. The default value is 60 seconds.


FinishResult

Properties

status

status: VerificationStatus

The status of the verification process.

It can be one of the following: 'Unknown', 'Accept', 'Reject', 'Review'. 'Unknown' indicates that the verification process resulted in error.

transactionId

transactionId: string


IdvFlowProps

Properties

apiConfig

apiConfig: ProxyConfig | TransactionConfig

Configuration options for communication with Microblink Platform API.

If the mode is set to classic, you need to provide the ProxyConfig object. If the mode is set to d2d, you need to provide the TransactionConfig object.

consentData

consentData: ConsentData

Data which indicates user choices for storing and processing personal data.

enableD2D?

optional enableD2D: boolean

Flag which indicates whether the SDK should use device-to-device feature or not. This feature is only used if the mode is set to classic. If the mode is set to d2d, this flag will be ignored.

If set to true, the SDK will check the current device camera and if it detects camera is not adequate for scanning, it will offer a transition to another device. Keep in mind that this feature only works on the desktop devices, D2D feature is not supported on mobile-to-mobile devices. If this flag is set to false, feature will be disabled and all flows will be executed on the current device, regardless of the camera quality. This flag is set to false by default.

mode?

optional mode: WorkingMode

Defines the working mode of the SDK. This is used to determine how the SDK will behave in terms of device-to-device communication. The working mode can be set to either classic or d2d. If the mode is set to classic, and d2d is enabled, the SDK will act as the primary device in the device-to-device flow. If the mode is set to d2d, the SDK will act as the secondary device in the device-to-device flow. The default value is classic.

onAbort()?

optional onAbort: () => void

Callback function which will be triggered when user has exited the workflow before completion.

Returns

void

onCardScanResult()?

optional onCardScanResult: (result) => void

Callback function which will be triggered when card scan result is available. This is used to handle the result of the card scan, which includes details such as card number, expiry date, and other relevant information.

Parameters
ParameterTypeDescription
resultCardScanResultcontains the result of the card scan.
Returns

void

onError()?

optional onError: (errorData?) => void

Global error callback function which will be triggered on various error conditions.

NOTE: Currently used only for scanning timeout error, but can be extended for other error states in the future.

Parameters
ParameterTypeDescription
errorData?{ capability?: string; errorType?: ERROR_SCAN_TIMEOUT; transactionId?: string; }Contains useful information about the error: - capability: The capability on which the error occurred (e.g., 'DocVer', 'BlinkId') - transactionId: The transaction ID associated with the error - errorType: The type of error that occurred (e.g., 'ERROR_SCAN_TIMEOUT') which you can use to handle different scenarios
errorData.capability?string-
errorData.errorType?ERROR_SCAN_TIMEOUT-
errorData.transactionId?string-
Returns

void

onExit()?

optional onExit: (status) => void

Parameters
ParameterTypeDescription
status"completed" | "aborted"signals whether the workflow has been completed or aborted.
Returns

void

Deprecated

This callback is deprecated and will be removed in future versions. Use onTransactionFinished and onAbort callbacks instead for handling workflow completion and abortion.

Callback function which will be triggered in two situations:

  1. Workflow has been completed
  2. User has exited the workflow before completion.
onTransactionFinished()?

optional onTransactionFinished: (result) => void

Callback function which will be triggered when transaction is finished.

Parameters
ParameterTypeDescription
resultFinishResultcontains the status of the transaction and the transaction ID. The status can be one of the following: 'Unknown', 'Accept', 'Reject', 'Review'
Returns

void

resourcesPath?

optional resourcesPath: string

Path to the resources folder which contains the wasm resources.

scanTimeout?

optional scanTimeout: number

Timeout duration in milliseconds for document scanning (DocVer and BlinkId capabilities).

For classic mode:

  • Works only when used in combination with onError prop.
  • onError callback will be triggered when user clicks on "Try another way" button when timeout error screen appears

For D2D hosted app:

  • it is enough to pass scanTimeout prop for triggering the timeout error.
  • When clicked on "Switch to desktop to continue" button on timeout error screen, user is switched to the primary device and onError callback from the primary hosted app will be triggered if provided.
  • onError prop provided to the D2D hosted app for timeout error is ignored.
themeOverride?

optional themeOverride: ThemeOverride

Defines options for customization and theming of a user interface.

translationsOverride?

optional translationsOverride: TranslationMessages

Options to override the default language. If not provided, the default language will be English. If you want to use SDK in another language, this object exposes all of the strings that can be translated.


ProxyConfig

This interface defines the configuration for the proxy server that will be used to communicate with the identity verification service. The goal of a proxy server is to provide additional layer of security when starting the transaction on the IDV service.

Properties

d2d?

optional d2d: D2DConfig

Configuration options for device-to-device.

formValues?

optional formValues: Record<string, string>

Custom fields that will be sent to the proxy server when starting the transaction which will be used in the defined workflow.

headers?

optional headers: ApiHeaders

The headers that will be sent to the proxy server when starting the transaction.

url

url: string

The URL of the proxy server.

workflowId

workflowId: string

The ID of the workflow to be executed. Workflow defines which steps will be executed.


ThemeOverride

This interface provides properties that can be used to define custom styles, colors, and icons for specific parts of the UI.

Properties

accent?

optional accent: object

A color palette that defines accent colors used throughout the UI. The palette follows a step system from 25 to 900 to allow for a range of shades.

NameType
100string
200string
25string
300string
400string
50string
500string
600string
700string
800string
900string
buttonBorderRadius?

optional buttonBorderRadius: string | number

Specifies the border radius of buttons throughout the UI.

This can be defined using CSS units (like px, em, or %) as a string or a plain number (which will be treated as pixels by default).

fontFamily?

optional fontFamily: string

Specifies the font family to be used throughout the UI. Font family name needs to be a valid CSS font-family value hosted inside parent web application.

resultsScreen?

optional resultsScreen: object

Defines icons used on the results screen to visually indicate different states of identity verification.

NameTypeDescription
identityNotVerifiedIcon?stringSpecifies the path to the icon used to represent an unverified identity.
identityVerifiedIcon?stringSpecifies the path to the icon used to represent a verified identity.
identityVerifyingIcon?stringSpecifies the path to the icon used to indicate that identity verification is in progress.
startScreenIcon?

optional startScreenIcon: string

Specifies the path of the icon to be displayed on the start screen. This allows for branding or a custom visual indicator on the initial screen.


TransactionConfig

Defines options to use SDK with existing transaction ID. This enables the SDK to be used in a scenario where the transaction has already been started by someone else, and SDK wants to either resume or start flow with that transaction ID. Useful scenarios include device-to-device flow, verifications links or other scenarios where transaction ID is shared.

Properties

apiUrl

apiUrl: string

Url which will be used to communicate with the Microblink Platform API.

d2d?

optional d2d: D2DConfig

Configuration options for device-to-device.

ephemeralKey

ephemeralKey: string

Key for communication with API.

transactionId

transactionId: string

The transaction ID that will be used in IDV flow.