> 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

Frame analyzed during stabilization.

## Details

Emitted on every 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 at `event.detail.detail`:

* `eventType` (`string`): Type of event emitted.
* `diagnostic` (`number`): Stabilization code for the current frame.

**Stabilization codes `diagnostic`**:

| Id   | Name                           | Description                                                  |
| ---- | ------------------------------ | ------------------------------------------------------------ |
| `1`  | Ok                             | Stabilization phase passed.                                  |
| `2`  | NotStabilized                  | The user must remain still and face forward.                 |
| `3`  | NotStabilizedTooFar            | The user must be in the default zone.                        |
| `4`  | NotStabilizedSunGlasses        | Occlusions on the face prevent detection.                    |
| `5`  | NotStabilizedTooClose          | The user must move farther away to avoid optical distortion. |
| `6`  | NotStabilizedTooMovement       | The user is not remaining 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 quality.                                        |
| `17` | OkGlasses                      | Stabilization passed with glasses.                           |
| `18` | NotStabilizedInvalidResolution | Invalid resolution (720 or 480 expected).                    |
| `19` | NotStabilizedMask              | Mask stabilization failed.                                   |

## Description

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

### Considerations

Emitted only if [stabilization](https://docs.facephi.com/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](https://docs.facephi.com/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;
});
```
