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

# moduleLoaded

## Details

It is emitted when the internal engine has finished its Initialization and the Widget is ready.

**Event:** `prefix`

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

### Syntax

```typescript
selphid.addEventListener('moduleLoaded', onModuleLoaded);
```

### Received object

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

* `eventType` (`string`): Type of event emitted.
* `camerasDeviceInfo` (`MediaTrackSettings[]` | `string`): Information about the device's cameras.
* `deviceType` (`string`): Type of device in use.
* `resolutionHeight` (`number`): Initial height resolution.
* `resolutionWidth` (`number`): Initial width resolution.
* `widgetConfiguration` (`object`): Effective configuration applied to the engine (e.g. `DocumentType`, `Rules`, `CaptureTimeout`).
* `widgetVersion` (`string`): Version of the engine component.

## Description

Allows external loading screens to be hidden or logic to be executed when the widget is ready to interact.

### 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)). `widgetConfiguration` reflects the final values after applying the wrapper's defaults and props.

***

## Example

```jsx
<facephi-selphid-widget
    onModuleLoaded={(event) => {
      const { widgetVersion, resolutionWidth, resolutionHeight } = event.detail.detail;
      console.log('SelphID loaded:', widgetVersion, resolutionWidth, resolutionHeight);
    }}
/>
```

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

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