Integration examples
A runnable capture workflow with explicit lifecycle handling.

Browser example
The downloadable SENSE example runs entirely in the browser using your self-hosted SDK. It includes an explicit Scan back button, progress feedback, cancellation and rescan. It emits a document-read event for your application to consume privately. It does not send document information to CEBS or approve a customer registration.
Start and release the reader
const options = {
edition: 'SENSE',
recognizer: 'document-aware-onnx',
recognitionPolicy: 'required-fields',
acceptanceMode: 'development',
assetBaseUrl: new URL('./sdk/0.2.0/', location.href).href,
preview: document.querySelector('video'),
manualCaptureEnabled: false,
serverFallbackEnabled: false,
};
// Prepare runtime assets before the user chooses Start camera.
await CEBSIDReaderWeb.CEBSIDReader.preload(options);
const reader = await CEBSIDReaderWeb.CEBSIDReader.create(options);
// Call from an explicit user action. Always release the camera.
try {
await reader.startCamera();
const result = await reader.scanDocument();
await presentForReview(result);
} finally {
await reader.dispose();
}Attach Start camera to a user-operated button. Keep one active reader for a capture flow. Use dispose when replacing it. A rescan should create fresh workflow state while allowing the browser to reuse downloaded assets. A hard refresh is not a normal rescan requirement.
Pause for the second side
onEvent: (event) => {
if (event.type === 'front-captured') {
reader.setCapturePaused(true);
showBackScanAction();
}
}
// On the explicit Scan back action:
reader.setCapturePaused(false);Tell the user when the captured image is being read so they know they can lower the document. Resume only after the user chooses to scan the second side. Do not accept a repeated first side as the second side.
Consume results privately
document.addEventListener('document-read', (event) => {
presentForReview(event.detail);
// Apply your own authorization and review workflow.
// Do not write identity information to console or analytics.
});Review extracted information against the source document. Corrections should start a fresh capture when the integration does not permit manual editing. OCR success is a data-extraction result, not an originality verdict.
Framework integrations
In React, keep the reader in a ref and dispose it during effect cleanup. Guard asynchronous results against an obsolete run when components unmount or users rescan. In any framework, stop the camera when the tab goes into the background and require a clear user action to restart.
