> Toden documentation. For the full index fetch /llms.txt. Every page is available as Markdown by appending .md to its URL. Every endpoint is under /api/v1. Identity verification and Risk Intelligence are separate contracts there with different error shapes; /api/kyc and /api/identity are older prefixes that still answer the same. Never invent an endpoint, field or enum value: read the API reference page for the operation first.

## SDKs 4.2.0, limit liveness attempts, and decline injected camera feeds by default

A session is now declined when the applicant fails the liveness check 3 times, the way it can be for one-time codes. A workflow can allow fewer tries, or turn the limit off. Presence Intelligence and Document Intelligence also get their own setting for an injected camera feed, which declines by default.

### Added

* **Maximum liveness attempts**, a setting on the Presence Intelligence step (`maxLivenessAttempts`, 1 to 3, or `false` to turn it off). It is on by default: a workflow that does not set it allows 3 failed checks. Each failed liveness check counts, across the desktop and phone legs of one verification. After each failure the SDKs say how many attempts are left. At the limit the liveness step is charged and the session is declined with `reasonCode` `liveness_attempts_exceeded`: the `session.declined` webhook fires, `GET /api/v1/status/:id` reads `declined`, and later requests on the session answer `409 session_declined`. Not offered for Passive Liveness, which has no check to fail during the flow.
* **Injection attack detected**, a setting on the Presence Intelligence step (`livenessInjection`: `approve`, `review` or `decline`). It acts when the liveness recording shows the camera feed was replaced (a virtual camera, a generated feed or a hooked camera).
* **Injection attack detected** for documents, a setting on the ID Verification step (`documentInjection`: `approve`, `review` or `decline`). It acts when a document captured with the camera was fed in rather than captured live by the device camera; today that is a recording of the capture that plays on a loop, as a virtual camera does. Results carry `documentInjection` (`detected`, `clear` or `not_checked`, with each side's status) on the webhook, the verification result and each ID of a multiple-ID verification, and workflows can branch on `verification.documentInjection`. An uploaded document or a server submission reads `not_checked`. In sandbox, `sandboxOutcome: document_injection` makes the capture read as injected. No extra charge.

### Changed

* **An injected camera feed now declines by default.** A verification whose liveness recording shows a replaced feed fails with `virtual_camera_detected` unless the workflow chooses Review or Approve. It used to go to review through the Device Intelligence virtual camera rule, and did nothing when Device Intelligence was off. That rule now covers only virtual cameras the SDK reports itself, and keeps its Review default.
* **A borderline selfie now goes to review instead of being declined.** A selfie that fails only on its face match (`reasonCode` `selfie_mismatch` with the data matching) and scores no more than 10 below the pass mark, so 70 to 79 at the default 80, is sent to manual review by default. The verification result is unchanged (`FAILED`, `selfie_mismatch`, with its `facialConfidence`); the workflow's decision is review, as it already was with a review band set in the builder. A workflow that set its own review band, or any decision rule on `verification.facialConfidence`, keeps it. To keep pass or fail only, remove the review band in the facial match threshold (stored as `facialReviewBand: false`).
* **An injected document capture also declines by default**, with the new `reasonCode` `document_injection`, unless the ID Verification step's **Injection attack detected** is set to Review (held for review, no rule needed) or Approve. Signs of forgery or tampering on a document are a different check and still go to review.

### What you need to do

To keep sending injected feeds to review, set **Injection attack detected** to Review on the Presence Intelligence step, and on the ID Verification step for documents, and publish. Handle `document_injection` like `virtual_camera_detected`. The liveness limit is on: treat `liveness_attempts_exceeded` like `contact_attempts_exceeded`, a final outcome, or turn **Limit liveness attempts** off to keep unlimited retries. Expect borderline selfies in your review queue rather than declined; remove the review band to keep declining them. The limit needs the 4.2.0 SDKs below; older SDKs do not report failures, so their applicants keep unlimited retries.

### SDKs 4.2.0

`@toden/react` 4.2.0, `@toden/react-native` 4.2.0 and `toden_flutter` 4.2.0 are out. The mobile SDKs skip 4.1.0, so all three share one number. Each package's changelog lists every change.

* **The liveness limit.** Each failed face check is reported, the failure panel shows the attempts left as a small warning, and the flow ends on a declined screen ("We couldn't verify your face") at the limit, with `onError` receiving `session_declined` once.
* **Declined sessions and used-up codes.** A session declined after too many incorrect codes ends on its own screen instead of an error, and a used-up code field stays closed until a new code is sent.
* **An explanation before the chip read** on React Native and Flutter: how to hold a passport or card, with the photo page ticked when it was already read. The read starts on Continue.
* **Android release builds scan again in Flutter.** R8 removed the classes ML Kit starts from, so 4.0.0 and 4.0.1 release builds never detected a document or a face. The SDKs' keep rules now cover them (React Native too).
* **Each document side is submitted with its own recording, or none**, never one left from an earlier capture of that side.
* **Your organisation's logo and the device's light or dark setting by default**, when neither your app nor the workflow sets them.

To upgrade:

1. Web: `npm install @toden/react@4.2.0`. See the [Web SDK](/integrate/sdks/react) guide.
2. React Native: `npm install @toden/react-native@4.2.0`, then rebuild your Android app once so its release build picks up the keep rules. See the [React Native SDK](/integrate/sdks/react-native) guide.
3. Flutter: `toden_flutter: ^4.2.0` in `pubspec.yaml`, `flutter pub get`, then rebuild. See the [Flutter SDK](/integrate/sdks/flutter) guide.