Monitoring Data Collection
Optional implementation
Monitoring Data Collection is optional. If you adopt it, only the prepareCamera call is affected — every other step in the capture flow (initialization, listeners, result handling) remains unchanged.
Attach user and flow metadata to a capture session so it can be correlated in monitoring and observability tools on Unico's side. When provided, the data is forwarded alongside the capture — it does not change the SDK's capture behavior or the API response.
PrepareInfo attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
externalUserId | String | ✅ | User identifier in your system. Automatically hashed with SHA-256 before transmission — never sent in plain text. |
useCase | String | — | Identifier for the flow or context running (e.g., "account_opening", "password_recovery"). Transmitted as plain text. |
Implementation
Create a PrepareInfo object and pass it as the third argument to prepareCamera. Everything else in the capture flow stays the same.
- Kotlin
- Java
val extraData = PrepareInfo(
externalUserId = "external_user_id",
useCase = "use_case"
)
unicoCheckCamera.prepareCamera(unicoConfig, object : CameraListener {
override fun onCameraReady(cameraOpener: UnicoCheckCameraOpener.Camera?) {
cameraOpener?.open(cameraListener)
}
override fun onCameraFailed(message: String?) {
Log.e(TAG, message)
}
}, extraData)
PrepareInfo extraData = new PrepareInfo("external_user_id", "flow_id");
unicoCheckCamera.prepareCamera(unicoConfig, new CameraListener() {
@Override
public void onCameraReady(UnicoCheckCameraOpener.Camera cameraOpener) {
cameraOpener.open(cameraListener);
}
@Override
public void onCameraFailed(String message) {
Log.e(TAG, message);
}
}, extraData);