# *CHANGELOG*

## *CHANGES* v9.3.1

### Changes

- **A deliberate stop no longer reports an error**: Calling `stop()` while the SDK was still starting up, or a user exiting during load, tore down the DOM and camera underneath the initialisation still in flight. The resulting failures were reported through `onError` as `init_error:1003` or `capture_error:4004`, telling you initialisation had failed or the camera was denied when in fact the session had been cancelled on purpose. A requested teardown is now silent on `onError`. Genuine failures are unaffected. **Action:** none. If you suppressed these codes around your own `stop()` calls, that workaround is no longer needed.
- **Camera preview correction now recovers when the phone is busy at startup (Bug Fix)**: The iOS 27 correction shipped in v9.2.0 only took effect if the browser happened to be free to redraw at the exact moment the camera opened, which on a phone busy starting up it often is not. It is now attempted again over the following seconds, so the preview corrects itself shortly after appearing rather than staying small for the session. It also always restores the preview if the correction fails part-way, where an error could previously leave it invisible. The follow-up attempts only happen when the device was actually too slow to redraw, measured rather than assumed, so a phone that corrected immediately does not blink again. **Known limitation:** a device that stays fully occupied for several seconds may still show the smaller preview until it frees up. The area reserved for the preview is always sized correctly, so captured images are unaffected either way.

## *CHANGES* v9.3.0

### Changes

- **Unsupported devices now report a `device_error` instead of a model failure**: AutoCapture requires WebAssembly with SIMD support, and a device without it cannot run the SDK at all. Those devices previously reported `model_error:6001` ("Could not load models"), which reads as a temporary network or loading problem and invited a retry that could never succeed. They now report a new `device_error` category, meaning "unsupported device, do not offer a retry": `device_error:7002` when WebAssembly is unavailable, and `device_error:7003` when SIMD is unavailable. The codes are identical in the FaceVerify SDK, so an integration embedding both can use one handler. **Action:** if you branch on error codes, treat `device_error` as terminal and show an unsupported-device message rather than a retry. In practice `7003` means iOS below 16.4; see [Compatibility](README.md#compatibility) for the full minimum-version table.
- **Camera failures are now distinguishable**: Every camera failure reported `capture_error:4004` ("camera denied"), whether the user actually declined, the device has no camera, another app was holding it, or the requested constraints could not be met. The underlying `DOMException` was logged and then discarded, so the reported error carried a code and no root cause, and the four cases could not be told apart in logging. `getUserMedia` failures are now classified by their `DOMException` name: `capture_error:4007` when no camera is available, `capture_error:4008` when it is in use by another app or tab, and `capture_error:4009` when the constraints cannot be satisfied. `4004` keeps its meaning, a genuine denial, and remains the fallback for anything unrecognised, so handlers matching on the `capture_error` prefix are unaffected. The original `DOMException` now appears in the error's `chain`, so its `name` (for example `NotReadableError`) is available for diagnosis instead of being discarded. **Action:** none required. If you show camera recovery UI, note that a retry is worth offering for `4004` and `4008` but not for `4007`.
- **A device without WebAssembly no longer hangs**: Previously these devices reported nothing at all. `onError` never fired and the SDK stayed on its loading state indefinitely, so the session could not end and the user was left waiting. It now fails immediately with `device_error:7002`. Unexpected failures during start-up are also reported through `onError` now instead of being swallowed.
- **New `device_error` language key**: The overlay message for an unsupported device comes from a `device_error` key, added to the built-in defaults and to all 16 bundled translations, with the same wording the FaceVerify SDK uses. **Action:** if you supply a custom `LANGUAGE` object, add a `device_error` entry to get translated text. Without one the SDK falls back to its built-in English default, so nothing breaks.
- **Clearer message when the device is unsupported**: The `message` on the reported error named the missing technology, which an end user cannot act on. It now states the requirement in terms of the device and names the iOS version that provides it, and arrives on `onError` intact so it can be shown to the user as-is.

## *CHANGES* v9.2.0

### Changes

- **Camera preview no longer appears undersized on iOS 27 (Bug Fix)**: On iOS 27, currently in public and developer beta, the preview could be drawn smaller than the area reserved for it, righting itself only if the user zoomed or switched camera. The area was always sized correctly, so captured images were never affected, only what the user saw. The preview is now redrawn as the camera opens, while the loading indicator is still shown, and again whenever the camera changes its frame size afterwards.

## *CHANGES* v9.1.0

### Changes

- **Custom footer logo (white-label)**: You can now replace the DataChecker logo shown in the footer with your own, using the new `LOGO` setting. Point it at an image URL or an inline image, or hide the logo entirely. When you do not set it, the default DataChecker logo is shown as before. (See [Configuration](README.md#configuration) table for details.)

## *CHANGES* v9.0.0

### ⚠️ Breaking Changes

- **Unrecognised documents no longer blocked or reported as an error**: The SDK no longer shows a "document not allowed" screen or raises a `not_allowed` error for a document that does not match `ALLOWED_DOCUMENTS`. Document-type rejection moves server-side to DataChecker's document classification service, which validates the captured document during processing. **Action required:** if your `onError` handler treats `not_allowed` as a document rejection, remove that branch; it no longer fires. See the [v9 Migration Guide](docs/migration_guide_v9.md).
- **Manual capture button on by default**: `CAPTURE_BTN_AFTER` now defaults to `10000` ms (was off), so the button appears 10 seconds after start if no capture has completed. **Action required:** set `CAPTURE_BTN_AFTER: 0` to keep it hidden. See the [v9 Migration Guide](docs/migration_guide_v9.md).

### Changes

- **Lenient document capture**: AutoCapture now steers instead of blocking. A confidently recognised, requested document (and the requested side, if specified) auto-captures as before; anything else is captured manually with a flip prompt. Document-type rejection is not removed, it moves server-side to DataChecker's document classification service, which keeps the SDK resilient to new and updated documents without an SDK update.
- **Removed the unused `not_allowed` message**: The "document not allowed" overlay message has been removed from the SDK and all bundled languages, since it is no longer shown. If you provide your own `LANGUAGE` object, a `not_allowed` entry in it is now unused (harmless to leave, safe to remove). See the [v9 Migration Guide](docs/migration_guide_v9.md#custom-language-files).

## *CHANGES* v8.0.0

### ⚠️ Breaking Changes

- **Generic runtime errors recategorised**: The generic runtime catch-all error (`PROCESSING_ERROR`) moved from `capture_error:4001` to its own category `runtime_error:8001`. Previously a generic runtime failure was reported under `capture_error` and showed the camera-specific overlay message; it now has a dedicated `runtime_error` category and a generic message. The `capture_error` category is now camera-only. The number `4001` is retired and will not be reused. **Action required:** if your `onError` handler matches the exact string `capture_error:4001`, switch it to `runtime_error:8001`; if it routes generic runtime errors via the `capture_error` prefix, note that they now arrive under `runtime_error`. See [Error Codes](README.md#error-codes) and the [v8 Migration Guide](docs/migration_guide_v8.md).

### Changes

- **New `runtime_error` overlay message (custom languages)**: The new `runtime_error` error category has its own user-facing overlay message, which is included in all languages bundled with the SDK. If you provide your own custom `LANGUAGE` object, add a `runtime_error` entry for a localized message; without it the SDK falls back to the English default ("Something went wrong. Please try again."), so this is recommended but not required. See the [v8 Migration Guide](docs/migration_guide_v8.md).
- **Manual Capture Bypasses Validation Checks**: When the user manually triggers a capture (force capture / capture button), the SDK now bypasses the allowed-document-type (`ALLOWED_DOCUMENTS`) restriction and the environment/exposure and focus quality checks, so a manually requested capture is accepted even when auto-detection is unsure. Document flipping follows the `ALLOWED_DOCUMENTS` configuration: if any allowed document type is two-sided, a manual capture expects two images (front, then a flip), while if every allowed type is single-sided it completes in one image (a document already flipped is not asked again).
- **Improved Capture Stability (Bug Fix)**: Resolved two rare conditions that could end a capture session prematurely with an error. One occurred during startup before motion detection was fully ready, and one was caused by a transient camera-frame read failure on some browsers. Both are now recovered from automatically, so capture continues uninterrupted.
- **Black Frame / False "Too Dark" on Some Android Devices (Bug Fix)**: On the high-performance capture path, certain devices (for example Samsung Galaxy S24 and S25) deliver camera frames in a YUV pixel format (I420) that the SDK did not decode. The result was an all-black frame that was wrongly rejected as "Environment is too dark", so capture could never start even in good lighting. The SDK now decodes I420 (and NV21) frames correctly. As a broader safeguard against device and browser variation, any camera pixel format the fast path does not recognise now automatically falls back to the format-agnostic capture path instead of failing, so an unexpected format degrades to a slower-but-working capture rather than a blocked session.
- **Deterministic Camera Selection**: When more than one eligible camera is available (back-facing/environment with continuous auto-focus), the SDK now sorts the cameras by label before picking the first one, then opens it at the requested ideal 4K resolution. This makes the chosen camera consistent across sessions and devices instead of depending on the browser's enumeration order.

## *CHANGES* v7.2.3

- **Faster on Android**: Android Chrome now reads camera frames via the WebCodecs API and runs a lighter movement check, reducing per-frame overhead and improving capture frame rate. iOS and older Android continue to work unchanged.
- **More Consistent Capture Performance**: Eliminated intermittent slow-frame spikes that could briefly stall capture, by reducing per-frame memory allocations in the processing pipeline. PaperCapture mode in particular runs noticeably more consistently.
- **Sharper Captures on Modern Browsers**: On browsers that support the ImageCapture API (Chromium-based, e.g. Android Chrome), the live preview now streams at a lighter resolution for smoother, lower-overhead processing while the final document image is captured at the camera's full photo resolution. iOS Safari and older Android stream at high resolution as before, so saved-image quality is preserved everywhere.
- **Smoother Animations**: The capture checkmark, tutorial prompts, and document-flip animations have been reworked to play reliably across devices. The checkmark in particular now plays its full animation even on devices with system-level "Remove animations" settings enabled.
- **Bug Fix — Focus Check After Re-acquisition**: After the SDK briefly loses sight of a document (for example, when it moves out of the frame), the focus check now correctly re-baselines when the document is found again, preventing rare cases where users could get stuck in a re-check loop.
- **Bug Fix — Unintended Page Scroll**: Fixed an issue where the SDK's mount container could be scrolled vertically on mobile and desktop, allowing users to drag past the capture UI. The SDK now reliably fills the viewport without exposing a scrollable area.
- **Support for new languages**: (see [Languages](README.md#languages))
  - Bulgarian (bg)
  - Czech (cz)
  - German (de)
  - Spanish (es)
  - French (fr)
  - Hungarian (hu)
  - Italian (it)
  - Lithuanian (lt)
  - Papiamento (pa)
  - Polish (pl)
  - Portuguese (pt)
  - Romanian (ro)
  - Slovak (sk)
  - Ukrainian (uk)

## *CHANGES* v7.2.2

- **Updated automation pipeline**: Updated the pipeline for publishing the package to NPM.

## *CHANGES* v7.2.1

- **Faster on Android**: Substantially improved frame processing speed on Android devices by reducing redundant pixel work in the capture pipeline.
- **More Reliable Focus Detection**: Final capture now requires a short streak of consecutive in-focus frames rather than a single one, preventing the rare case where two coincidentally similar blurry frames could pass the focus check.

## *CHANGES* v7.2.0

- **Richer `onError` Payload**: `onError` now receives `{ code, stack, message, chain }`. `message` and `chain` are new optional fields — the existing `code` and `stack` are unchanged so current integrations continue to work without modification.
  - `message`: human-readable description of the outermost error. Particularly useful on Safari/iOS, where the browser's `.stack` string does not include the message header (V8/Chrome prepends it; JavaScriptCore/Safari does not). Read `message` separately if you need the description cross-browser.
  - `chain`: array tracing the full causal chain, outermost first, root cause last. Each entry contains `name`, `message`, optional `code`, and `stack`. The root cause's `code` is usually the most actionable; chain depth is capped at 10 to bound payload size. See [Error Codes](ERROR_CODES.md) for the full shape.
- **Single Reporting Channel**: All internal errors are now reported exclusively through `onError`. `init()` no longer rejects on failure — consumers that previously relied on `await sdk.init().catch(...)` will not receive errors that way; they will arrive through `onError` instead. Adding `.catch()` on `init()` is no longer necessary and will not surface error events. This change removes duplicate logging and prevents unhandled promise rejections in consumers that did not wrap `init()`.
- **Log-Level Convention Documented**: The category prefix of each `code` (`init_error`, `capture_error`, `model_error`, etc.) maps to a recommended log severity (`ERROR`, `WARN`, `INFO`). See [Log-level convention](ERROR_CODES.md#log-level-convention) for the mapping — useful for routing capture errors to alerting and reserving `INFO` for user-driven events like `exit`.

## *CHANGES* v7.1.0

- **Enhanced detection model**: The detection model has been upgraded to improve accuracy and performance, with improved glare detection and added support for vertical documents:
  - Netherlands Residence Permit 2026
  - Cameroon ID Card 2025
  - Iceland ID Card 2024
  - French ID Card 2014
- **Bug Fix**: Fixed incorrect animations displayed during Identity Card capture.

## *CHANGES* v7.0.1

- **Bug Fix**: Fixed a double-capture issue on desktop where `onComplete` could fire twice due to overlapping frame processing after a tab visibility change.
- **Documentation**: Added [migration guide index](docs/README.md) linking to v3, v4, and v7 migration guides.
- **Documentation**: Added upgrade banner to [README](README.md) pointing users to migration guides.

## *CHANGES* v7.0.0 ⚠️ BREAKING CHANGE

- **Structured Error Codes (Breaking)**: `onError` now receives an object `{ code, stack }` instead of a plain string. The `code` follows the format `category:NNNN` (e.g., `capture_error:4004`). Include both `code` and `stack` when reporting issues to support. See [Error Codes](README.md#error-codes) for the full list of categories and recommended actions. See [Migration Guide v7](docs/migration_guide_v7.md) for upgrade instructions.
- **Improved Stability**: Fixed multiple crashes related to exit timing, external DOM removal, camera stream interruption, and component loading failures. All errors are now reported through `onError` with structured error codes instead of crashing silently. Language load failures now correctly surface as `settings_error:2004`. Token verification failures now include a more detailed stack trace in `error.stack`.
- **Resource Cleanup**: Camera streams are now fully released on error, and lingering timers are properly cancelled when the SDK stops. This prevents resource buildup in single-page applications where the SDK is initialized multiple times.
- **New Language Keys**: Added 5 new keys for error message categories: `init_error`, `settings_error`, `token_error`, `opencv_error`, `model_error`. Custom language files should add these keys to provide translated error messages; the SDK falls back to English defaults if they are missing.
- **OpenCV reduced**: Reduced OpenCV build size from 10.1 MB to 2.4 MB, resulting in faster load times and lower memory usage.

## *CHANGES* v6.1.1

- **Alert Stability**: Improved alert handling, repeated alerts no longer flicker, and critical errors stay visible until the user exits or refreshes.
- **Reduced CPU Usage**: Processing is now capped at a maximum of 20 fps, preventing excessive resource usage on high-refresh-rate devices.
- **Background Pause**: The SDK now automatically pauses when the app is backgrounded, reducing battery drain and heat on mobile devices.
- **Bug Fixes**: Various stability fixes including error container isolation, improved motion detection accuracy, and edge case handling.

## *CHANGES* v6.1.0

- **Manual Capture Button with Instructional Dialog**: Enhanced the manual capture experience when `CAPTURE_BTN_AFTER` is configured (see [Configuration](README.md#configuration)). An instructional dialog now appears before showing the capture button, informing users about the manual capture option. Auto-capture remains enabled while giving users the ability to manually trigger capture at their convenience. The dialog only appears once per session to avoid repetitive interruptions, and supports both autocapture and papercapture SDK modes with appropriate tutorial graphics.
- **Document Type Validation**: Added real-time validation of captured documents against `ALLOWED_DOCUMENTS` configuration (see [Allowed documents](README.md#allowed-documents)). When a user captures a document type that is not allowed, a clear error message is displayed with a "forbidden" icon, prompting them to use a different document type. Unknown document types (`UNK`) automatically trigger the `onError` callback to ensure only recognized documents are processed.
- **PaperCapture Mode Enhancement**: The `ALLOWED_DOCUMENTS` configuration is now ignored when `SDK_MODE` is set to `'papercapture'`. Document type validation and restrictions only apply in `'autocapture'` mode, allowing papercapture to process any paper document without configuration constraints.
- **New Language Translations**: Added `manual_mode` and `not_allowed` messages to both English and Dutch language files for internationalization support (see [Languages](README.md#languages)).

## *CHANGES* v6.0.9

- **Improved cropping**: Increased padding for cropped pictures to ensure edges remain visible.
- **Bug Fix**: Fixed retry button on approval screen not restarting capture.

## *CHANGES* v6.0.8

- **Bug Fix**: Fixed errors caused by frozen or immutable configuration objects by implementing internal cloning of settings to prevent mutations.

## *CHANGES* v6.0.7

- **Content Security Policy (CSP)**: Added Content Security Policy (CSP) documentation to the README. (see [Content Security Policy (CSP)](README.md#content-security-policy-csp))

## *CHANGES* v6.0.6

- **Enhanced camera selection**: Improved filtering of available cameras to prioritize back-facing devices and exclude virtual or unsupported cameras, ensuring more reliable capture on multi-camera setups. (see `DESKTOP_MODE` in [Configuration](README.md#configuration))
- **Added device label to output metadata**: The output metadata now includes the label of the active camera device used during capture. This enhancement provides better traceability and context for the captured images, allowing users to identify which camera was utilized in multi-camera setups. The device label can be found in the `device` field of the output metadata. (see [Output](README.md#output))

## *CHANGES* v6.0.5

- **Infrastructure**: Backend infrastructure updates and improvements to the publishing pipeline. No functional changes to the SDK.

## *CHANGES* v6.0.4

- **Enhanced document support**: Improved support for `NLD Residence Permit Diplomatic`.

## *CHANGES* v6.0.3

- **Added `DESKTOP_MODE` setting**: Introduced a development/testing mode that enables all cameras regardless of `facingMode` filtering. **FOR TESTING ONLY - NOT FOR PRODUCTION USE.** Desktop cameras are typically labeled with `facingMode: 'user'` instead of `'environment'`, which would normally be filtered out. This mode bypasses camera filtering to facilitate testing on desktop devices. Production environments should always use the default `false` value to ensure only back-facing cameras are available on mobile devices. (see [Configuration](README.md#configuration))
- **Improved logging**: Replaced generic `console.log` calls with appropriate log levels (`console.info`, `console.warn`, `console.error`) for better log categorization and filtering.

## *CHANGES* v6.0.2

- **Bug Fix**: Fixed Worker initialization failures caused by CORS restrictions when using different hostnames or CDN assets. Workers are now created from blob URLs with properly resolved WASM paths for reliable cross-origin support.
- **Backward Compatibility**: Added mapping from `ID` to `IDENTITY_CARD` in settings for backward compatibility. Users can now use either `ID` or `IDENTITY_CARD` in the `ALLOWED_DOCUMENTS` configuration. When `ID` is used, it will automatically be mapped to `IDENTITY_CARD` internally. (see [Allowed documents](README.md#allowed-documents))
  
  Example:

  ```javascript
  // Both configurations are now supported:
  ALLOWED_DOCUMENTS: {
      ID: ['FRONT', 'BACK'],  // Legacy - automatically mapped to IDENTITY_CARD
      IDENTITY_CARD: ['FRONT', 'BACK']  // Preferred
  }
  ```

## *CHANGES* v6.0.1

- **Removed straightness check**: The document straightness validation has been removed from the quality control pipeline. The `straight` alert message is no longer shown to users, improving the capture experience by reducing false rejections.
- **Enhanced focus check**: Focus validation is now applied throughout the entire quality control pipeline instead of only on the last 2 frames, resulting in more consistent focus quality across all captured frames.

## *CHANGES* v6.0.0

- **Heatmap-driven detection pipeline**: Document inference now leverages heatmap-based corner extraction, exposing orientation and IoU scores for more reliable cropping.
- **Expanded quality checks**: Added straightness, corner completeness and occlusion validations to block poor frames before capture.
- **Unified AutoCapture and PaperCapture pipelines**: Shared base processing keeps ROI rendering, flip handling, and quality control consistent across modes.
- **Updated user messaging**: Language packs now include prompts for corner alignment, occlusion, and straightening while removing MRZ-specific alerts.
- **OpenCV WebAssembly upgrade**: Switched to the SIMD-enabled build and reorganized asset paths for faster preprocessing across supported browsers.

### Breaking Changes v6.0.0

- **MRZ** support removed: The MRZ detection and scanning functionality has been removed from the SDK. As a result, the following settings have been removed: `MRZ_SETTINGS`, `MRZ`.
- **Removed `onImage` callback**: The `onImage` callback hook is no longer emitted and must be removed from integrations.
- **Removed `ALWAYS_FLIP` setting**: Flip behaviour is handled automatically; the `ALWAYS_FLIP` configuration flag is no longer supported.
- **SIMD only**: The SDK now exclusively uses the SIMD (Single Instruction, Multiple Data) version of WebAssembly for improved performance.

## *CHANGES* v5.1.1

- **Updated README**: The README file has been updated to include the latest changes and improvements in the SDK. See [Languages](README.md#languages) for the updated alert messages.
- **Bug Fix**: Resolved an issue where the SDK run into OOM (Out Of Memory) errors on certain devices during multiple instances of the SDK in the same environment. This fix ensures smoother performance and stability when using multiple instances.

## *CHANGES* v5.1.0

- **Improved processing time**: The processing time has been significantly reduced, resulting in faster image processing and detection.

- **PaperCapture support**: The SDK now supports capturing paper documents in addition to identity documents. (see [Configuration](README.md#configuration))
  - **Added `CAPTURE_BTN_AFTER` setting**: Enables a manual capture button, available for both AutoCapture and PaperCapture modes.
  - **Added `SDK_MODE` setting**: Allows configuration of the SDK mode as either `'autocapture'` or `'papercapture'` for tailored usage.

- **Enhanced user experience**:
  - **Tap to start after camera selection**: Now you are required to *tap to start* again after changing cameras, this is done to prevent the SDK from automatically resuming the capturing process.
  - **Improved focus detection**: Enhanced focus checks provide more reliable detection and faster processing.
  - **Better quality control**: Quality checks are now more targeted based on the selected SDK mode for improved accuracy.

- **Bug fixes and improvements**:
  - Improved frame processing efficiency for smoother performance.
  - Enhanced coordinate detection for more accurate document positioning.
  - Enhanced tutorial animations
  - Moved ML engine to separate Web Worker for improved memory management.

## *CHANGES* v5.0.1

- **Improved Camera Selection for iOS Triple Cameras**: Addressed issues with iPhones featuring three cameras, where automatic switching sometimes resulted in blurry images. The camera selection logic has been enhanced to reliably choose the correct camera based on the device's system language. Supported languages include: English, Dutch, Spanish, German, French, Italian, Polish, Romanian, Slovak, Ukrainian, Czech, Bulgarian, Hungarian, Lithuanian, and Portuguese. For unsupported languages or devices other than iPhone with three cameras, the default back camera will be used.
- **Bug Fix**: Fixed an issue where coordinates in metadata were not returned correctly.

## *CHANGES* v5.0.0

- **Enhanced detection model**: The detection model has been upgraded to improve accuracy and performance, now supporting Sedula documents and providing better detection for Dutch Driving Licenses.
- **Disabled blur quality control**: The blur quality control has been removed from the detection process. See [Languages](README.md#languages) for the removed `blur` alert message.

### Breaking Changes v5.0.0

- **Removed face cropping**: The `CROP_FACE` functionality has been removed. Thus, the `'face'` output will no longer be present in the output.

## *CHANGES* v4.1.2

- **Enhanced detection model**: The detection model has been upgraded.
- **Improved blur detection**: Blur detection has been enhanced by leveraging higher resolution images, ensuring better image quality and more accurate detection results.
- **Focus check improvement**: The focus check has been improved by implementing a motion detection algorithm, providing more reliable focus assessment.
- **Blur alert change**: The "blur" alert has been updated. (see [Languages](README.md#languages))
- **iOS Pro phones zoom**: Implemented a 1.5x zoom on iOS Pro phones (3 lenses) to address focus issues caused by automatic camera switching.
- **Decreased consecutive good frames**: The number of consecutive good frames required has been decreased, resulting in faster capturing.
- **Version number display**: The version number is now visible on the screen, providing users with clear information about the current version of the application.

## *CHANGES* v4.1.1

- **Increased resolution**: The maximum resolution has been increased to 3840x2160 for sharper output images.
- **Output format change**: Changed the output format from PNG to JPEG to reduce the size of the output images.
- **Bug Fix**: Improved blur detection to enhance image quality.

## *CHANGES* v4.1.0

- **Enhanced detection model**: The detection model has been upgraded to support the latest NLD 2024 cards, offering improved accuracy and performance.

## *CHANGES* v4.0.3

This is a major update. If you are currently using version 3, there is a [migration guide](docs/migration_guide_v4.md) available to help you transition to version 4.

### Breaking Changes

- **Removal Crop card**: Removed the capability of cropping the card in the output image (`CROP_CARD`). The output image will be the roi area oriented to the card.
- **Internal OCR Removed**: The internal OCR has been removed due to performance concerns. However, hybrid OCR functionality remains available. Because of this, the following `MRZ_SETTINGS` are deprecated: [`FLIP`, `FLIP_EXCEPTION`, `FLIP_INCLUDE`, `OCR`, `RTW`]. As be seen, the `FLIP` configurations now moved from `MRZ_SETTINGS` to `ALLOWED_DOCUMENTS`.
- **Removal of `CAPTURE_BTN_AFTER`**: The `CAPTURE_BTN_AFTER` setting has been removed.
- **Removal of `GLARE_LIVE_CHECK`**: The `GLARE_LIVE_CHECK` setting has been removed. A glare check will always be performed.

### Improvements

- **New detection model**: Improved the detection model, it now will perform card detection and quality control.
- **New allowed documents setting**: You can now use the `ALLOWED_DOCUMENTS` setting to enable or disable flipping of certain documents. Please refer to the [ALLOWED DOCUMENTS](README.md#allowed-documents) section for more details.

## *CHANGES* v3.1.5

- **Enhanced MRZ detection**: Improved capability to detect the presence of MRZ on document.

## *CHANGES* v3.1.4

- **Optimized `opencv.js` Size**: Reduced the size of `opencv.js`, resulting in faster loading times.
- **Added SIMD Support**: `opencv.js` now supports SIMD (Single Instruction, Multiple Data) for enhanced performance.
- **Efficiency Improvements**: Made minor efficiency fixes, leading to a smoother process.
- **Enhanced Camera Filtering**: Improved camera filtering based on `facingMode` and `focusMode` capabilities.
- **Updated Compatibility Requirements**: The SDK requires at least ECMAScript 12 (ES12). Please refer to the [Compatibility](README.md#compatibility) section for more details.
- **Bug Fix**: Resolved issues related to adaptive exposure.
- **Bug Fix**: Resolved focus issues with incorrect camera selection by refining focus mode criteria.

## *CHANGES* v3.1.3

- Bugfix: The new document detector introduced in version `v3.1.0` was not properly utilized.

## *CHANGES* v3.1.2

- Bugfix: Resolved an issue where AutoCapture (version 3.1.0 and above) failed to load on iOS devices.

## *CHANGES* v3.1.1

- Bugfix: Fixed an issue where conflicts occurred when loading different ONNX engines in the same environment, such as when different SDKs are used simultaneously.

## *CHANGES* v3.1.0

- Decreased size of `autocapture.obf.js` by 8.38 MiB, resulting in faster loading time.
- New document detector, documents without MRZ can now be captured before their other side with MRZ.
- Improved UI/UX.
- Changed notifications. (see [Languages](README.md#languages))
- Capture button configuration. (see [Configuration](README.md#configuration))
- Camera selection is now possible. This can be used as a fallback when the automatic back camera detection fails.
- Clean-up codebase.

- Bugfix: No Camera access native iOS now throws the expected error.

## *CHANGES* v3.0.2

- Bugfix: Personal number was not returned in NLD / BEL ID docs.

## *CHANGES* v3.0.1

- Add V3 migration guide

## *CHANGES* v3.0.0

- Increased max resolution to 1080x1980 for sharper output images.
- Auto-exposure for android.
- Only enable SDK when allowed in token.
- New OCR model which reduces memory footprint which caused the OCR to fail on certain Android devices.
- Android phones will only have live glare check on last frame to decrease runtime.
- Added demo token functionality.
- Restructured codebase. AutoCapture and FaceVerify can now both be loaded in the same page.
- CSS identifiers renamed.
- Notications can now be loaded as object (json) in config. (See [Languages](README.md#languages))
- Added `viewport-fit=cover` to the `<meta> 'viewport'` properties, to get fullscreen.
- Landscape mode capturing now possible.
- Repositioned Task box.
- Introduction `FLIP_INCLUDE` to only flip on certain criteria. (See [MRZ Configuration](README.md#mrz-configuration-mrz_settings))
- **Removed** Paper only option.
- Introduction `force_capture` flag, indicating which of the output images are captured by force. (See [Output](README.md#output))
- Introduction `ROI_MODE` to select a `ROI` (frame) orientation. (see [Configuration](README.md#configuration))
- Introduction `ALWAYS_FLIP` to always flip even when there is no `MRZ` scanning. (see [Configuration](README.md#configuration))
- Removal of `ROOT`. (see [Configuration](README.md#configuration))
- Refactored Codebase.
- Introduction `ASSETS_MODE` and `ASSETS_FOLDER` to fetch assets. (see [Configuration](README.md#configuration))
- Introduction `BACKGROUND_COLOR` to change background color. (see [Configuration](README.md#configuration))
- NPM install now available
- Script tag import, ES6 style import and CommonJS style import. (see [Importing SDK](README.md#importing-sdk))
- Version control between Assets and Main file. (see [Version control](README.md#version-control))
- Customizable background color. (see [Configuration](README.md#configuration))
- Meta tags are now added automatically.
- Detailed integration examples. (see [Examples](examples/README.md))
- Renamed module `Autocapture` to `AutoCapture`.
- Decreased package size by removing redundant files.

- Bugfix: Short camera glitch on startup iOS.
- Bugfix: Notifications could not be updated twice.
- Bugfix: iOS back cameras are not switching anymore.
- Bugfix: Size check is now depended on the area with respect to the ROI rather than the pixel area.
- Bugfix: Resizing screen caused an error on force capture.
- Bugfix: Wait until opencv is ready.

## *CHANGES* v2.0.1

- Created [Changelog](#changelog), moved previous logging of changes from [README](README.md) to [Changelog](#changelog).
- Readme addition of [Prerequisites](README.md#prerequisites), [OAuth Token](README.md#oauth-token), [Steps](README.md#steps).
- Moved Readme [SDK Token](README.md#sdk-token).
- [Handling callbacks](README.md#handling-callbacks) are now all **required** instead of **optional**.
- Missing **required** settings will throw an error. (see [Configuration](README.md#configuration))
- Now, errors will be thrown when images are missing.
- Improved underexposure check.
- Added Debug logging. (see [Configuration](README.md#configuration))
- Rewritten documentantion on MRZ scanning. (see [MRZ](README.md#mrz))
- Rewritten documentantion on [Android integration](/android/README.md).

- Bugfix: Task still visibile after completed proces. Task now will be hidden.
- Bugfix: WASM SIMD not supported on all devices. Added more WASM support files.

## *CHANGES* v2.0.0

**BREAKING CHANGE!**

Please note: The migration from V1 to V2 is a breaking change. The outputs are changed and the SDK is locked with a token.

- Added Token with validation. Application can only be started with a valid token. (see [SDK Token](README.md#sdk-token), [Configuration](README.md#configuration))
- Added cropping of face. (see [Configuration](README.md#configuration), [Output](README.md#output))
- Portrait mode requirement, landscape will throw an alert.
- New Tap-to-start screen.
- New flip animations.
- Added Android integration documentation at `android/`.

## *CHANGES* v1.1.0

- Added paper document detection. (see [Configuration](README.md#configuration))
- New UI.
- Decreased size ONNX engine.
- Glare classification instead of segmentation.
