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

# trackStatus

## Details

It is emitted after user actions or state changes during the capture Flow.

**Event:** `trackStatus`

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

### Syntax

```typescript
selphid.addEventListener('trackStatus', onTrackStatus);
```

### Received object

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

* `eventType` (`string`): Type of event emitted.
* `currentState` (`string`) | `tapButton` (`string`) | `retriesConsumed` (`number`) | `documentPresent` (`boolean`): Dynamic key with the state, action, or capture metadata (only those present in each emission).

**Values `currentState`**:

| Value          | Description                          |
| -------------- | ------------------------------------ |
| `initializing` | The SelphID engine is initializing.  |
| `initEngine`   | Engine Initialization in progress.   |
| `ready`        | SelphID has loaded and is ready.     |
| `analyzing`    | The current image is being analyzed. |
| `previewImage` | The capture preview is shown.        |
| `resetting`    | The internal engine is restarting.   |
| `finish`       | The capture has finished.            |
| `error`        | An error has occurred in the Flow.   |
| `end`          | The extraction has finished.         |

**Values `tapButton`**:

| Value                | Description              |
| -------------------- | ------------------------ |
| `tutorial`           | Tutorial button pressed. |
| `exit`               | Close button pressed.    |
| `repeatExtraction`   | Retry capture.           |
| `continueExtraction` | Continue extraction.     |
| `finishExtraction`   | Finish extraction.       |
| `retryExtraction`    | Retry extraction.        |
| `switchCamera`       | Camera switched.         |
| `back`               | Go back.                 |

## Description

Allows tracking user actions and the Widget's internal state changes.

### 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)).

***

## Example

```jsx
<facephi-selphid-widget
    onTrackStatus={(event) => {
      const detail = event.detail.detail;
      console.log('Track status:', detail);
    }}
/>
```

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

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