Device-to-device configuration
Read more about D2D to understand the functionality. This article handles SDK-related configuration.
In a device-to-device flow, the user starts a verification on a desktop (the primary device), and continues it on their phone (the secondary device), which has a better camera.
You don't turn on device-to-device in the SDK. Whether it's off, offered to the user, or enforced comes with the transaction, so the same SDK configuration works for every case.
Choose where to run D2D
You can use our infrastructure for the D2D (secondary) web apps, or you can host your own.
Use the Microblink-hosted page
In your configuration, don't set runAddress.
If device-to-device is enabled for the transaction, the join link points to the page that Microblink hosts.
Host the page yourself
Set runAddress on the desktop to the URL of your page:
import { createPlatformSdk } from '@microblink/platform-sdk';
createPlatformSdk({
sessionToken: sdkConfiguration,
runAddress: 'https://verify.example.com/continue',
});
The join link points to your page, and carries a session token for the phone in its sdk query parameter, for example:
https://verify.example.com/continue?sdk=eyJ0cmFuc2FjdGlvbklkIjoi...
Your page reads the parameter, and passes it to the SDK as it is:
import { createPlatformSdk } from '@microblink/platform-sdk';
const sessionToken = new URLSearchParams(window.location.search).get('sdk');
if (sessionToken) {
createPlatformSdk({ sessionToken });
}
That's all the phone page needs. Don't parse or decode the token; the SDK recognizes that it runs on the phone from the token itself.
Serve the phone page over HTTPS, because browsers allow camera access only on secure pages. The phone page also needs the camera resources.