> ## Documentation Index
> Fetch the complete documentation index at: https://docs.idesify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Every option accepted by createVerification, and the controller it returns

## createVerification(options)

<ParamField path="token" type="string" required>
  Session token minted by your backend. Never an API key.
</ParamField>

<ParamField path="container" type="HTMLElement" required>
  The element the flow mounts into.
</ParamField>

<ParamField path="baseUrl" default="/api/v1/verification" type="string">
  Endpoint prefix. Set it when Idesify is on another origin, or when you proxy the API through your own domain.
</ParamField>

<ParamField path="language" type="string">
  BCP-47 tag. Sets `Accept-Language` so the server localizes its copy, and selects the SDK's own dictionary. Built-in: `en`, `es`, `pt`, matched on the primary subtag and falling back to `en`.
</ParamField>

<ParamField path="colorScheme" default="system" type="&#x22;light&#x22; | &#x22;dark&#x22; | &#x22;system&#x22;">
  Color scheme for the bundled UI. `system` follows `prefers-color-scheme` and re-resolves live when the user flips it.
</ParamField>

<ParamField path="accent" type="string">
  Brand accent, as any CSS color. Overrides the dashboard theme in both light and dark, so you can brand the flow without changing dashboard settings.
</ParamField>

<ParamField path="slots" type="UISlots">
  White-label hooks. `labels` overrides SDK-owned strings per key; `renderTerminal` replaces the result screen entirely.
</ParamField>

<ParamField path="callbacks" type="VerificationCallbacks">
  `onStep`, `onProgress`, `onComplete`, `onError`, `onExpire`.
</ParamField>

<ParamField path="autoStart" default="false" type="boolean">
  Skip the intro screen and begin immediately. The intro screen's language picker and theme toggle are skipped too, so pass the `language` and `colorScheme` you want.
</ParamField>

<ParamField path="wasmInput" type="InitInput">
  Only needed if you self-host the engine binary as a separate asset instead of using the inlined default.
</ParamField>

<ParamField path="debug" default="false" type="boolean">
  Developer only. Overlays raw detection geometry and a numeric pose readout on the capture screens.
</ParamField>

<Warning>
  Leave `debug` off in production. It surfaces raw coordinates and confidence readouts that confuse end users, and it is intended for integration troubleshooting only.
</Warning>

## VerificationController

| Member | Description |
| - | - |
| `start()` | Fetch configuration and begin. Idempotent. |
| `resume(newToken)` | Swap in a freshly minted token and resume after `onExpire` or an error. |
| `destroy()` | Stop the camera, clear frame buffers, remove the UI, drop listeners. |
| `state()` | One of `idle`, `loading`, `running`, `processing`, `complete`, `expired`, `error`. |
| `on(event, handler)` | Emitter mirror of the callbacks. Returns an unsubscribe function. |
| `off(event, handler)` | Remove a handler registered with `on`. |

The emitter events are `step`, `progress`, `complete`, `error`, and `expire` — the same signals as the callbacks, if you prefer subscribing over passing an options object.

## Callbacks

| Callback | Fires when |
| - | - |
| `onStep` | The flow advances to a new screen. Receives `step`, `index`, and `total`. |
| `onProgress` | A within-step milestone occurs, such as a capture completing. |
| `onComplete` | The server has reached its decision. Fires once. |
| `onError` | A failure surfaces. Receives `error` and a `fatal` flag. |
| `onExpire` | The session token expired. Mint a new one and call `resume`. |

<Note>
  `onComplete` is the only authoritative signal. `onStep` and `onProgress` describe what the user is doing, not what the server concluded — never gate business logic on them.
</Note>

## The capture experience

These behaviors ship in the bundled UI and need no configuration:

* **Press feedback.** Primary buttons show an inline spinner on click and disable their siblings, so a tap cannot be double-fired while the next screen prepares.
* **Cropped review.** After each document capture the review screen shows only the detected document, not the whole camera frame. This is preview-only and does not change what is submitted.
* **Screen transitions.** A light fade and rise between screens; camera previews fade only, to avoid video layout shift. All of it honors `prefers-reduced-motion`.
* **Attribution.** A subtle "Powered by Idesify" mark sits at the bottom of every screen. It is localized and overridable through `slots.labels.powered_by`.

## Theming

The dashboard theme drives the palette. The SDK resolves the effective colors and writes them as `--idv-*` CSS custom properties on the flow root.

* **`accent`** applies in both light and dark. Neutral surface tokens come from the active mode's base palette.
* **`colorScheme`** picks light or dark, defaulting to the OS preference.
* The camera viewfinder uses the ID-1 card aspect ratio with a `cover` preview and a dimmed mask outside the frame.

For a full white-label, override `slots.labels` for per-string copy, supply `slots.renderTerminal` to own the result screen, or set the `--idv-*` variables yourself on the container.
