> 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/selphi-biometria-facial/eventos/trackstatus.md).

# trackStatus

## Details

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

**Event:** `trackStatus`

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

### Syntax

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

### Received object

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

* `eventType` (`string`): Type of event emitted.
* `currentState` (`string`) | `tapButton` (`string`): Dynamic key with the state or action (only one present per emission).

**Values `currentState`**:

| Value          | Description                            |
| -------------- | -------------------------------------- |
| `initializing` | The Selphi engine is initializing.     |
| `ready`        | Selphi has loaded and is ready.        |
| `liveness`     | The active liveness check has started. |
| `analyzing`    | The capture process has started.       |
| `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.    |
| `startCapture`     | Capture started.         |
| `repeatExtraction` | Retry capture.           |
| `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/selphi-biometria-facial/eventos.md#formato-de-los-eventos)).

***

## Example

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

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

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