Migrate to v2
Version 2 of the Platform brings numerous changes: you no longer need to deploy any proxy, the API has been simplified, while the SDKs can now run "headless", allowing more customization.
This migration guide leads you through the steps you need to take in order for your existing integration to work with v2. It doesn't explain or use the new functionalities that we've added. For that, use the release notes and the rest of the documentation.
V1 of the Platform will be maintained and supported until June 2027. It will not receive improvements or new coverage.
At a glance
To migrate an integration from v1 to v2:
- Collect the end user's consent in your app before verification starts; the SDKs no longer handle consent.
- Create transactions on your backend by calling the v2 Agent API and return the
sdkConfigurationfrom the response to your app. - Move your other Agent API calls to the v2 paths, and remove calls to endpoints that no longer exist.
- If you create verification links, send a
userIdinstead of the consent. - Update the SDK to v2, and pass it the
sdkConfigurationinstead of your proxy, workflow, and consent settings. - Update how you handle results and customize the UI.
- Update how you use biometrics in your workflows.
No proxy
You are no longer expected to deploy any type of proxy.
Previously, our intended usage expected that you deploy either our own transaction proxy, or an equivalent.
With v2, this is no longer required, and the expectation is that you handle the call to the Platform API. The intended sequence is:
- The user starts verification in your app.
- Your backend ensures that the end user is authenticated.
- If not already collected, your backend collects their consent and calls
POST /api/v2/transactionon the Agent API. - The API returns
sdkConfiguration. - Your backend returns it to your app.
- Your app passes it to the Platform SDK code.
- The SDK code in your app progresses the transaction on the Edge API.
Your client_id and client_secret never leave your backend, exactly as with the proxy.
The difference is that there's no separate service to deploy and the call is part of your application.
(You can keep using some proxy setup instead, but a) there's no expectation of it anymore, and b) our own proxy implementation won't be extended to v2.)
Example in Python
Here's how that might look using requests and Flask:
import os
import requests
from flask import Flask, jsonify, request
AGENT_API_URL = "https://api.us-east.platform.microblink.com/agent"
AUTH = (os.environ["MB_CLIENT_ID"], os.environ["MB_CLIENT_SECRET"])
app = Flask(__name__)
def create_transaction(workflow_id: str, platform: str, user_id: str) -> dict:
body = {
"workflowId": workflow_id,
# One of: "Android", "Ios", "Browser", "Backend" (no SDK), "None"
"platform": platform,
"consent": {
"userId": user_id,
# Must be true for the consent to be accepted.
"isProcessingStoringAllowed": True,
"isTrainingAllowed": False,
# "givenOn" is optional and defaults to the current time.
},
}
response = requests.post(
f"{AGENT_API_URL}/api/v2/transaction",
auth=AUTH,
json=body,
timeout=10,
)
response.raise_for_status()
return response.json()
@app.post("/start-verification")
def start_verification():
# Authenticate your end user here (session, JWT, etc.) before doing anything else.
user_id = request.headers.get("X-User-Id")
if not user_id:
return jsonify({"error": "Unauthorized"}), 401
transaction = create_transaction(
workflow_id=os.environ["MB_WORKFLOW_ID"],
platform=request.json.get("platform", "Browser"),
user_id=user_id,
)
# "sdkConfiguration" is an opaque token that carries everything the SDK
# needs to continue on the Edge API. Hand it over as-is.
return jsonify({"sdkConfiguration": transaction["sdkConfiguration"]})
New biometrics
In this release, we're updating our biometrics.
If you used the Selfie, Liveness & Face Match step in your workflows, here are the changes that you'll see:
- No more setting face analysis tolerance to soft, regular or hard; instead you turn on or off individual checks (face match, liveness, capture integrity and evidence integrity).
- In step transaction rules, the scores no longer use percentages, but a graded scale. The new defaults roughly correspond to old defaults: 80% or less on face match is now 4 or below; 50% or less on liveness is now 2 or below. You will also notice that you can have conditional branching inside the step transaction rules ("set to if... but set to if...").
We've also introduced new features, such as setting retries, and the previously mentioned individual sub-checks. For a full walkthrough, see Selfie, Liveness & Face Match.
API changes
The v2 API brings breaking changes. Its surface is smaller than in v1: it drops tags, analytics, diagnostics, and transaction retries.
This section lists how the API has changed, and what you need to change in your v1 integration to start using v2.
It will not list all individual fields that may have been changed or removed, if these fields are internal fields that external integrations didn't use.
For a full API reference, see the Agent API reference or view the API schema directly.
New URL
The host and base path are unchanged.
Only the version segment changes, from v1 to v2.
- before:
https://api.{region}.platform.microblink.com/agent/api/v1/... - after:
https://api.{region}.platform.microblink.com/agent/api/v2/...
Find your region here.
Removed Agent API endpoints
If you call any of the following in v1, there is no v2 equivalent:
POST /transaction/{transactionId}/retry- Tags:
GET /organization/{organizationId}/transaction-tag/recent,POST /transaction/{transactionId}/tag, andDELETE /transaction/{transactionId}/tag. Thetagsquery parameter onGET /organization/{organizationId}/transactionis removed as well. - Analytics: everything under
/analytics - Diagnostics: everything under
/diagnosticsand/entity-change
The endpoints that remain at the new v2 path correspond to:
- creating and managing transactions, e.g.
POST /transaction,GET /transaction/{transactionId} - verification links, e.g.
POST /verification-link - managing user profiles and monitors, like
GET /userprofile/{id},GET /organization/{organizationId}/monitor
Changes in the create transaction request
POST /api/v2/transaction still takes an application/json body.
consentis now required; you now also must provideconsent.userIdand setconsent.isProcessingStoringAllowedtotrue.sdkVersionis removed.workflowIdandplatformare required, as before.formValues,props, andcorrelationIdare unchanged.
{
"workflowId": "ed8f5b8efd2a90c37e0b8aac",
"platform": "Browser",
"consent": {
"userId": "unique-user-id",
"isProcessingStoringAllowed": true
}
}
Changes in the create transaction response
The response to POST /transaction is completely different.
All response fields from v1 are dropped, and v2 only has sdkConfiguration.
This is a Base64-encoded string intended to be handed to an SDK. Store and return it as-is; do not parse or modify it.
{
"sdkConfiguration": "eyJ0cmFuc2FjdGlvbklkIjoi..."
}
Changes in the transaction object
This applies to GET /transaction/{transactionId} and to each item in GET /organization/{organizationId}/transaction.
clientVersion,partnerId, andsdkVersionare removed.consentis now always present.tagsis still returned, but the v2 API has no way to add or remove tags.
The transaction object also contains new fields, which should have no effect on previous integrations.
Certain internally used fields have also been removed or rearranged.
Changes in verification links
You no longer provide consent when creating a verification link. Instead:
- You create the link.
- The end user clicks the link.
- The verification link web app collects the consent from the user.
So, in /verification-link:
consentis removed, and replaced by a requireduserIdexpiresOnandworkflowIdare now required.runAddressis no longer supported: verification links always open in our managed app, so if you host your own verification link app, retire it and stop settingrunAddress.formValues,props,redirectUrl, andcorrelationIdare unchanged.
{
"workflowId": "ed8f5b8efd2a90c37e0b8aac",
"userId": "unique-user-id",
"expiresOn": "2026-10-01T00:00:00Z"
}
The response is unchanged, and still contains id and url:
{
"id": "01988877-9797-7be0-a889-b071c4a13292",
"url": "https://..."
}
Send the url to the end user, as before.
When you get a link with GET /verification-link/{verificationLinkId}, address and partnerId are removed from the response.
Edge API
The Edge API has changed too, but it is only used by our SDKs, and it was never intended to be called directly by an API consumer. If your v1 integration calls the Edge API directly, it will not work with v2, and there is no migration path for it. Integrate one of the SDKs instead, and let it drive the Edge API for you.
Consent
Consent is now mandatory.
- Creating a transaction without a
consentobject is rejected. consent.isProcessingStoringAllowedmust betruefor the consent to be accepted.consent.givenOnis optional and defaults to the current time.- Verification links don't take a
consentobject anymore; they take auserIdinstead.
SDK changes
This section explains which changes have happened with the v2 SDKs, and how you should change your integration to accommodate them.
This guide is use-case-oriented, explaining the changes in the underlying Platform functionality and how these changes are expressed in the SDK integration. We use platform-specific code samples to illustrate the changes you need to make.
If you need only an integration guide applicable to your platform, use one of these:
Headless mode
The main change in our SDKs is the introduction of a "headless" mode.
V2 SDKs consist of a "core" library that handles the mechanics of your workflow. This is the new headless mode, in which you have full autonomy over how you want the SDK to look. You integrate the core library, and then you build all the visuals yourself.
On top of that, a "user experience" library adds our visuals: different screens, messaging, and so on. This bundles the core library, but also provides our default screens, and certain limited options for customization.
Implementation might be different on different platforms, but the basic conceptual split is the same.
This migration guide covers the second integration path (full managed UI). For documentation on how to use only the core library, see SDK architecture.
Update the SDK
- Web
- Android
- iOS
The package name hasn't changed and you still get it from NPM.
npm install @microblink/platform-sdk@2
Dependencies: you only need react (version 18 or later) if you use the React entry point, and vite (version 5 or later) if you use the Vite plugin.
If you integrate with vanilla JS, you can remove react, react-dom, and styled-components from your dependencies.
Update your Gradle file to v2. The SDK no longer brings in the scanning SDKs, so add the ones your workflows need:
dependencies {
implementation(platform("com.microblink:microblink-platform-bom:2.0.0"))
implementation("com.microblink:microblink-platform")
// Only the ones your workflows need:
implementation("com.microblink:blinkid-verify-ux") // document scanning
implementation("com.microblink:blinkcard-ux") // card scanning
implementation("com.microblink:biometrics-ux") // face capture
}
Minimum Android level is now 26, up from 24.
In Xcode: set the dependency for MicroblinkPlatform to version 2.0.0, and add the scanning SDKs that your workflows need. For details, see Migrate the iOS SDK to v2.
The minimum iOS version is now iOS 17.0, up from iOS 16.0.
Configuration
The v2 configuration is smaller than v1 on every platform, because it mostly accepts a configuration object from your own backend (which receives it from the Agent API, as explained in No proxy). What you configure "locally" is now mostly visual customization.
Web
- v1
- v2
{
apiConfig: {
proxy: { baseUrl: '...' },
workflowId: '...',
formValues: {},
d2d: { runAddress: '...' },
},
consentData: {},
mode: 'classic',
enableD2D: false,
scanTimeout: 60000,
target: element,
resourcesPath: '/resources',
themeOverride: {},
translationsOverride: {},
startScreen: () => {},
progressScreen: () => {},
endResultScreen: () => {},
onTransactionFinished: () => {},
onAbort: () => {},
onError: () => {},
onExit: () => {},
onCardScanResult: () => {},
}
{
sessionToken: '...',
runAddress: '...',
target: element,
resourcesPath: '/',
theme: {},
translations: {},
}
Android
- v1
- v2
MicroblinkPlatformConfig(
mbpResultListener = resultListener,
mbpServiceSettings = MicroblinkPlatformServiceSettings(
workflowId = "...",
proxySettings = MicroblinkPlatformProxySettings(
url = "...",
startTransactionPath = "/transaction",
cancelWorkflowPath = "/initialize/{workflowId}/cancel",
workflowInfoPath = "/initialize/{workflowId}/info",
additionalRequestHeaders = emptyMap(),
),
consent = MicroblinkPlatformConsent(
userId = "...",
isProcessingStoringAllowed = true,
isTrainingAllowed = false,
givenOn = System.currentTimeMillis(),
),
correlationId = null,
),
mbpUiSettings = MicroblinkPlatformUiSettings(
colorScheme = colorScheme,
typography = MicroblinkPlatformTypography.default(),
mbpImages = MicroblinkPlatformImages(),
buttonShape = ButtonShape(CircleShape),
documentScanningTypography = documentScanningTypography,
),
mbpCardScanResultListener = cardScanResultListener,
)
MicroblinkPlatformConfiguration(
engine = EngineConfiguration(
service = ServiceSettings(
sdkConfiguration = "...",
retryPolicy = NetworkRetryPolicy(),
),
),
resultListener = resultListener,
ui = UiConfiguration(
colorScheme = colorScheme,
typography = MicroblinkPlatformTypography.default(),
images = MicroblinkPlatformImages(),
buttonShape = CircleShape,
),
cardScanResultListener = cardScanResultListener,
)
iOS
- v1
- v2
let serviceSettings = MicroblinkPlatformServiceSettings(
workflowId: "...",
url: "...",
consent: MicroblinkPlatformConsent(
userId: "...",
isProcessingStoringAllowed: true,
isTrainingAllowed: false,
isGivenOn: .now
),
additionalRequestHeaders: [:],
correlationId: nil
)
serviceSettings.getWorkflowInfo = "..."
serviceSettings.startTransaction = "..."
serviceSettings.cancelWorkflow = "..."
let configuration = EngineConfiguration(
service: ServiceSettings(
sdkConfiguration: "...",
retryPolicy: NetworkRetryPolicy()
)
)
Start a verification
In v1, your app gave the SDK a proxy URL, a workflow ID, and the end user's consent, and the SDK created the transaction.
In v2, your app asks your backend to create the transaction (see No proxy), and passes the sdkConfiguration it gets back to the SDK.
That's all the SDK needs to start, so remove the proxy URL, the workflow ID, and the consent from your app.
If you set a correlationId in the SDK, remove it as well, and have your backend send it in the create transaction request instead.
- Web
- Android
- iOS
createIdvFlow is replaced by createPlatformSdk, which you import from @microblink/platform-sdk instead of @microblink/platform-sdk/vanilla.
You pass sdkConfiguration to it as sessionToken:
createIdvFlow({
apiConfig: {
proxy: { baseUrl: 'https://your.proxy.server' },
workflowId: 'ID of the workflow to use',
},
consentData: {
userId: 'unique user ID',
isProcessingStoringAllowed: true,
},
onTransactionFinished: (result) => {
console.log(result.transactionId, result.status);
},
onAbort: () => {
console.log('User aborted the flow');
},
target: document.getElementById('idv-flow-div'),
});
// Your own endpoint that calls POST /api/v2/transaction and returns sdkConfiguration.
const response = await fetch('/start-verification', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ platform: 'Browser' }),
});
const { sdkConfiguration } = await response.json();
const sdk = createPlatformSdk({
sessionToken: sdkConfiguration,
target: document.getElementById('idv-flow-div'),
});
sdk.onTransactionEnd((result) => {
console.log(result.transactionId, result.verificationStatus);
});
sdk.onAbort((info) => {
console.log('User aborted the flow on step', info.step);
});
In React, the IdvFlow component is replaced by the usePlatformSdk hook, which owns the session, and the PlatformFlowUI component, which renders our screens.
You pass your configuration to usePlatformSdk, and place PlatformFlowUI where the flow should appear:
function Verification() {
return (
<IdvFlow
apiConfig={{
proxy: { baseUrl: 'https://your.proxy.server' },
workflowId: 'ID of the workflow to use',
}}
consentData={{ userId: 'unique user ID', isProcessingStoringAllowed: true }}
onTransactionFinished={(result) => console.log(result.status)}
/>
);
}
// sessionToken is the sdkConfiguration your backend returned.
function Verification({ sessionToken }) {
const sdk = usePlatformSdk({ sessionToken });
useEffect(() => {
if (sdk.currentStep === 'END' && sdk.state.verificationStatus) {
console.log(sdk.state.transactionId, sdk.state.verificationStatus);
}
}, [sdk.currentStep, sdk.state.verificationStatus]);
return <PlatformFlowUI config={sdk} />;
}
The entry point is unchanged: you call MicroblinkPlatform.startVerification, and the SDK opens a separate activity for the verification screens.
MicroblinkPlatformConfig is renamed to MicroblinkPlatformConfiguration, and you pass sdkConfiguration to it in EngineConfiguration(service = ServiceSettings(sdkConfiguration)):
MicroblinkPlatform.startVerification(
activity = this,
configuration = MicroblinkPlatformConfig(
mbpResultListener = object : MicroblinkPlatformResultListener {
override fun onVerificationFinished(mbpResult: MicroblinkPlatformResult) {
Log.d("MBP", "Transaction ${mbpResult.transactionId}: ${mbpResult.state}")
}
override fun onVerificationCanceled(cancelState: MicroblinkPlatformCancelState) {
Log.d("MBP", "User canceled: ${cancelState.cancelReason}")
}
},
mbpServiceSettings = MicroblinkPlatformServiceSettings(
workflowId = "ID of the workflow to use",
proxySettings = MicroblinkPlatformProxySettings(
url = "URL of your proxy service"
),
consent = MicroblinkPlatformConsent(
userId = "unique user ID",
isProcessingStoringAllowed = true,
givenOn = System.currentTimeMillis()
)
)
)
)
// sdkConfiguration is the value your backend got from POST /api/v2/transaction.
MicroblinkPlatform.startVerification(
activity = this,
configuration = MicroblinkPlatformConfiguration(
engine = EngineConfiguration(
service = ServiceSettings(sdkConfiguration = sdkConfiguration)
),
resultListener = object : MicroblinkPlatformResultListener {
override fun onVerificationFinished(outcome: SessionOutcome.Verification) {
Log.d("MBP", "Transaction ${outcome.transactionId}: ${outcome.state}")
}
override fun onVerificationCanceled(outcome: SessionOutcome.Canceled) {
Log.d("MBP", "User canceled: ${outcome.reason}")
}
override fun onVerificationFailed(transactionId: String?, error: EngineError) {
Log.d("MBP", "Verification failed: $error")
}
}
)
)
MicroblinkPlatformSDK and MicroblinkPlatformSDKDelegate are removed.
Instead, MicroblinkPlatform.view(configuration:onEvent:) returns a SwiftUI view, and reports what happens through a single closure.
You pass sdkConfiguration to it in EngineConfiguration(service: ServiceSettings(sdkConfiguration:)).
As in v1, you present the SDK, and you dismiss it when it's done.
In a UIKit app, wrap the view in a UIHostingController:
let serviceSettings = MicroblinkPlatformServiceSettings(
workflowId: "ID of the workflow to use",
url: "URL of your proxy service",
consent: MicroblinkPlatformConsent(
userId: "unique user ID",
isProcessingStoringAllowed: true,
isTrainingAllowed: true,
isGivenOn: .now
)
)
let sdk = MicroblinkPlatformSDK(
serviceSettings: serviceSettings,
delegate: self
)
present(sdk.startSDK(), animated: true)
// MicroblinkPlatformSDKDelegate
func microblinkPlatformSDKDidFinish(
viewController: UIViewController,
result: MicroblinkPlatformResult
) {
print("Transaction ID:", result.transactionId)
print("Transaction status:", result.status)
viewController.dismiss(animated: true)
}
func microblinkPlatformSDKDidClose(
viewController: UIViewController,
cancelState: MicroblinkPlatformCancelState
) {
print("User exited:", cancelState.cancelReason)
viewController.dismiss(animated: true)
}
// sdkConfiguration is the value your backend got from POST /api/v2/transaction.
let configuration = EngineConfiguration(
service: ServiceSettings(sdkConfiguration: sdkConfiguration)
)
weak var presentedController: UIViewController?
let verificationView = MicroblinkPlatform.view(configuration: configuration) { event in
switch event {
case .finished(let result):
print("Transaction ID:", result.transactionId ?? "none")
print("Outcome:", result.outcome)
case .canceled(let cancelState):
print("User exited:", cancelState.reason)
case .cardScanned:
// The verification continues; don't dismiss.
return
@unknown default:
break
}
presentedController?.dismiss(animated: true)
}
let hostingController = UIHostingController(rootView: verificationView)
hostingController.modalPresentationStyle = .fullScreen
presentedController = hostingController
present(hostingController, animated: true)
In a SwiftUI app, present the view directly, for example with .fullScreenCover, and set the presentation state to false when you receive .finished or .canceled.
Handle the result
As in v1, the SDK tells your app when the end user finishes the verification or leaves it. What changes is how you subscribe, and the types you get.
- Web
- Android
- iOS
onTransactionFinished, onAbort, and onError are no longer configuration fields.
Instead, you subscribe to them on the SDK instance with sdk.onTransactionEnd(), sdk.onAbort(), and sdk.onError().
The result's status is renamed to verificationStatus.
React has no result callbacks; read the outcome from sdk.state instead, as in the example in Start a verification.
MicroblinkPlatformResultListener has a new method, onVerificationFailed(transactionId, error), which you must implement.
It's called when the verification ends with an error that the user can't retry, after they close the error screen.
The other two methods take new types:
onVerificationFinishedreceives aSessionOutcome.Verificationinstead of aMicroblinkPlatformResult.onVerificationCanceledreceives aSessionOutcome.Canceledinstead of aMicroblinkPlatformCancelState.
The delegate methods become cases of MicroblinkPlatformEvent, which your onEvent closure receives.
microblinkPlatformSDKDidFinish(viewController:result:)becomes.finished(MicroblinkPlatformResult).microblinkPlatformSDKDidClose(viewController:cancelState:)becomes.canceled(MicroblinkPlatformCancelState).
Collect consent before the verification
The SDKs no longer ask the end user for consent. Collect it in your app before the verification starts, and have your backend send it when it creates the transaction (see Consent). Then remove what's left of the SDK's consent handling from your app:
- Web
- Android
- iOS
Remove consentData from the SDK configuration.
- Remove
consentandMicroblinkPlatformConsentfrom your service settings. - Remove any overrides of the
mbp_consent_dialog_*string resources, because the SDK's consent dialog is removed. - If you handle the
ConsentDeniedcancel reason, remove that branch.
- Remove
consentandMicroblinkPlatformConsentfrom your service settings. - Remove any translations of the
mb-mp-consent-*keys, because the SDK no longer shows a consent screen. - If you handle the
consentDeniedcancel reason, remove that branch.
Set up device-to-device
This step applies to the web SDK.
You no longer turn on device-to-device (D2D) in the SDK: mode and enableD2D are removed.
Device-to-device flows are configured in the Platform UI for the workflow, and this information comes to the SDK in the session token.
If you host the D2D phone app yourself, move apiConfig.d2d.runAddress to the top-level runAddress field.
Otherwise, don't set it; if device-to-device is enabled for the transaction, the join link points to the Microblink-hosted page.