> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/codereader.md).

# codeReader

Optional QR code capture step after extracting the document.

## Details

**Attribute:** `code-reader`

**Type:** `CodeReader`

**Default value:** `CodeReader.Off`

### CodeReader

| Member      | Value         | Description                                                                                                                                        |
| ----------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Off`       | `'off'`       | Does not open the code screen or download reader assets (default value).                                                                           |
| `Optional`  | `'optional'`  | Opens the screen if the catalog requests it. If the capture budget is exhausted, it skips the code and emits `extractionFinish` no code data.      |
| `Mandatory` | `'mandatory'` | Same as `optional`, but if the code is not read it shows timeout and emits `extractionTimeout`. The retry resumes code scanning, not the document. |

## Morphology

```typescript
import { CodeReader } from '@facephi/selphid-web-component';

selphid.codeReader = CodeReader.Optional;
```

## Description

Activates a step **optional** of QR/code capture **during** a document extraction in `facephi-selphid-widget`.

It does not replace or use [`barcode`](/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/barcode.md) / [`barcodeSide`](/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/barcodeside.md): these control the document engine's barcode reader. `codeReader` mounts the same instance of `<facephi-selphid>` and is activated only with `settings.codeReader`.

The code result goes in `event.detail.ocrResult` (`encoded` e `images`), not in `result.images`. With `tokenize: true`, the current Tokenized payload uses keys such as `qr_back_0` and `qr_back_0_content`.

Related telemetry states in [`trackStatus`](/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/eventos/trackstatus.md): `codeInfo`, `readingCode`, `codesFinished`.

***

## Example

```jsx
import { CodeReader } from '@facephi/selphid-web-component';

<facephi-selphid-widget
    codeReader={CodeReader.Optional}
    captureRetries={3}
    captureTimeout={10}
/>
```
