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

# stabilizing

## Details

It is emitted on each frame while the stabilization process is active.

**Event:** `stabilizing`

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

### Syntax

```typescript
selphi.addEventListener('stabilizing', onStabilizing);
```

### Received object

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

* `eventType` (`string`): Emitted event type.
* `diagnostic` (`number`): Current frame stabilization code.

**Stabilization codes `diagnostic`**:

| Id   | Name                           | Description                                          |
| ---- | ------------------------------ | ---------------------------------------------------- |
| `1`  | Ok                             | Stabilization phase passed.                          |
| `2`  | NotStabilized                  | The user must remain still and facing forward.       |
| `3`  | NotStabilizedTooFar            | The user must be in the preset zone.                 |
| `4`  | NotStabilizedSunGlasses        | Facial occlusions prevent detection.                 |
| `5`  | NotStabilizedTooClose          | The user must move away to avoid optical distortion. |
| `6`  | NotStabilizedTooMovement       | The user does not remain still.                      |
| `8`  | NotStabilizedNoFrontal         | Face not centered (generic incorrect posture).       |
| `9`  | NotStabilizedNoFrontalTooLeft  | Face turned too far to the left.                     |
| `10` | NotStabilizedNoFrontalTooRight | Face turned too far to the right.                    |
| `11` | NotStabilizedNoFrontalTooDown  | Face tilted too far downward.                        |
| `12` | NotStabilizedNoFrontalTooUp    | Face tilted too far upward.                          |
| `13` | NoStabilizedNoColor            | Color image with insufficient color.                 |
| `14` | NotStabilizedLowQuality        | Low image quality.                                   |
| `15` | NotStabilizedLowFaceQuality    | Low face quality.                                    |
| `16` | NotStabilizedLowPatternQuality | Poor pattern.                                        |
| `17` | OkGlasses                      | Stabilization passed with glasses.                   |
| `18` | NotStabilizedInvalidResolution | Invalid resolution (720 or 480 expected).            |
| `19` | NotStabilizedMask              | Does not pass stabilization due to wearing a mask.   |

## Description

Reports the result of each stabilization attempt. When the widget returns `Ok` u `OkGlasses`, it advances to the next step before extraction.

### Considerations

It is only emitted if [stabilization](/docs.facephi-en/sdks/sdk-web/componentes/selphi-biometria-facial/propiedades/stabilization.md) is enabled. 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
    onStabilizing={(event) => {
      const { diagnostic } = event.detail.detail;
      console.log('Stabilizing diagnostic:', diagnostic);
    }}
/>
```

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

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