Skip to main content
Version: v2

Configuration

createPlatformSdk (vanilla JavaScript) and usePlatformSdk (React) take the same configuration object. (See the quick start for how to import and call these functions.)

Configuration object​

{
sessionToken: '...', // required
target: element,
runAddress: '...',
resourcesPath: '...',
theme: {},
translations: {},
}

Parameters​

sessionToken​

{
sessionToken: sdkConfiguration,
}

The sdkConfiguration value that your backend received when it created the transaction with POST /api/v2/transaction. Pass it as it is; don't parse or modify it.

On a phone that opened a device-to-device join link, the session token is the link's sdk query parameter instead. See Device-to-device.


target​

{
target: document.getElementById('verification'),
}

The element that the SDK renders its screens into. If you don't set it, the SDK renders in a full-screen overlay.


runAddress​

{
runAddress: 'https://verify.example.com/continue',
}

The URL of the page that the phone opens in a device-to-device flow. Set it only if you host that page yourself.

If you don't set it and device-to-device is enabled for the transaction, the join link points to the page that Microblink hosts. Read more in Run address.


resourcesPath​

{
resourcesPath: 'https://cdn.example.com/sdk/',
}

The base URL of the camera resources. The SDK loads the files from the resources/ folder under it.

Default: the folder of the current page. For a page at https://example.com/app/verify, the SDK loads the files from https://example.com/app/resources/.

A relative path is resolved against the page's URL, so prefer one that starts with /. Read Hosting resources.


theme​

{
theme: {
accent: '#0f766e',
fontFamily: "'Inter', sans-serif",
buttonBorderRadius: 8,
icons: { identityVerified: '/brand/verified.svg' },
},
}

The accent color, font, button radius, and images of our screens. Read Customization.


translations​

{
translations: {
error: { title: 'Something went wrong' },
},
}

Replaces any subset of the built-in English text. Read Customization.