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

# userCancel

## Details

It is emitted when the user closes or cancels the Widget.

**Event:** `userCancel`

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

### Syntax

```typescript
selphi.addEventListener('userCancel', onUserCancel);
```

### Received object

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

* `eventType` (`string`): Type of event emitted.
* `message` (`string`): Cancellation description.
* `advancedTracking` (`Uint8Array`): Encoded advanced Tracking (optional).

## Description

Allows reacting to voluntary cancellation.

***

## Example

```jsx
<facephi-selphi-widget
    onUserCancel={onUserCancel}
/>
```
