> 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/eventos/extractiontimeout.md).

# extractionTimeout

The capture time limit was reached.

## Details

Emitted when the widget cannot extract the document within the time configured in [captureTimeout](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/capturetimeout.md) and [captureRetries](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/captureretries.md).

**Event:** `extractionTimeout`

**Type:** `FacephiSelphidWidgetCustomEvent<ExtractionTimeoutEvent>` | `CustomEvent<ExtractionTimeoutEvent>`

### Syntax

```typescript
selphid.addEventListener('extractionTimeout', onExtractionTimeout);
```

### Received object

The useful payload is of type `SelphidExtractionTimeoutDetail` and is in `event.detail.detail`:

* `eventType` (`string`): Type of event emitted.
* `message` (`string`): Brief description of the timeout.
* `documentPresent` (`boolean`): Indicates whether a document was detected during the attempt.
* `code` (`string`): Associated error code.

## Description

Indicates that document capture was not completed in time. By default, the widget displays an expiration screen to the user.

With [`codeReader`](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/codereader.md) in `mandatory`, the same event is emitted if the code scanning budget runs out. In that case, retrying from [timeoutErrorButtonClick](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/eventos/timeouterrorbuttonclick.md) **resumes code scanning**, not document capture.

### Considerations

The useful payload is in `event.detail.detail` (see [event format](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/eventos.md#formato-de-los-eventos)).

If `captureTimeout` or `captureRetries` is `0`, this event is not emitted. The timeout screen includes a button that triggers [timeoutErrorButtonClick](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/eventos/timeouterrorbuttonclick.md).

This event is emitted for each expired attempt and does not close the flow. To limit the total number of attempts and detect when they run out, use [maxAttempts](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/maxattempts.md) together with [maxAttemptsExceeded](https://docs.facephi.com/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/eventos/maxattemptsexceeded.md).

***

## Example

```jsx
<facephi-selphid-widget
    onExtractionTimeout={(event) => {
      const { documentPresent, message } = event.detail.detail;
      console.log('Extraction timeout:', documentPresent, message);
    }}
/>
```

```typescript
import { type SelphidExtractionTimeoutDetail } from '@facephi/sdk-web-wc';

selphid.addEventListener('extractionTimeout', (event) => {
  const detail: SelphidExtractionTimeoutDetail = event.detail.detail;
});
```
