Skip to main content
Version: v3000

Handle errors and timeouts

This guide shows how to handle scanning that fails or times out, and how to tell when individual fields couldn't be read.

Handle scan failures and timeouts​

When you use the camera UI, the SDK exposes a single entry point for a session that finishes without a usable result. A finished-but-empty result generally means the user should retry.

Register an error callback. It receives one of a small set of error states, and these errors generally mean the user should retry:

  • "timeout": scanning ran longer than the allowed duration without completing
  • "result_retrieval_failed": the result could not be retrieved
  • "unknown": an unexpected error
blinkCard.addOnErrorCallback((error) => {
if (error === "timeout") {
// Prompt the user to try again in better conditions
}
void blinkCard.destroy();
});

Adjust the timeout​

The scanning timeout defaults to 10 seconds. Change it, or disable it, through the UX manager exposed on the component:

// Extend to 20 seconds
blinkCard.blinkCardUxManager.setTimeoutDuration(20000);

// Disable the timeout entirely
blinkCard.blinkCardUxManager.setTimeoutDuration(null);

Detect missing or unreadable fields​

When scanning completes, check the per-field extraction status to tell apart a field that was never present from one that was seen but couldn't be read.

In a photo flow, the process result carries a resultCompleteness object with one status per field.

const processResult = session.process(imageData);
const completeness = processResult.resultCompleteness;

if (completeness.cvvExtractionStatus === "not-extracted") {
// The CVV was visible but couldn't be read (blur, glare, occlusion) — ask for a clearer capture
}
if (completeness.cvvExtractionStatus === "not-present") {
// The CVV hasn't appeared yet — it may be on a side not scanned so far
}

Each field status is one of:

  • "extracted": the field was read successfully
  • "not-extracted": the field is present but couldn't be read—a blocking error that needs user action
  • "not-present": the field hasn't been seen on any scanned side yet
  • "not-requested": extraction was disabled for this field
  • "not-available": no status is available

Handle blur and poor lighting​

By default, BlinkCard rejects blurred frames so it only processes sharp images, which already guards against most low-quality captures.

If a scan keeps timing out because the input is consistently blurry, the most useful response is to guide the user: improve lighting, hold the card flat, and avoid glare. The built-in camera UI already shows this kind of real-time feedback.