> 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

## Details

It is emitted when the widget cannot extract the document within the configured time in [captureTimeout](/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/capturetimeout.md) and [captureRetries](/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 emitted event.
* `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 the document capture was not completed in time. By default, the widget shows an expiration view to the user.

### Considerations

The useful payload is in `event.detail.detail` (see [event format](/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](/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/eventos/timeouterrorbuttonclick.md).

This event is emitted on each expired attempt and does not close the flow. To limit the total number of attempts and detect when they are exhausted, use [maxAttempts](/docs.facephi-en/sdks/sdk-web/componentes/selphid-documentos/propiedades/maxattempts.md) along with [maxAttemptsExceeded](/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;
});
```
