> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fortepayments.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Compliance Events

> Client-side events emitted by the Forte Compliance widget. Use these to update your UI after verification completes or the widget is closed.

The Forte Compliance widget emits client-side `CustomEvent`s that you can listen to on your page. Use these to handle post-verification UX — such as showing a confirmation message, unlocking a feature, or re-prompting the user if they abandoned the flow.

<Note>
  Client-side events confirm user action in the widget UI — not on-chain state. For authoritative access level confirmation, query the [ACL contract](/acl_contract) directly.
</Note>

***

## Event Types

<AccordionGroup>
  <Accordion title="FortePaymentsWidgetLoaded" icon="download">
    Emitted once the widget script has loaded and the widget is ready to be initialized.

    A common pattern is to wrap the initialization call inside this listener:

    ```javascript theme={null}
    window.addEventListener('FortePaymentsWidgetLoaded', () => {
      window.initFortePaymentsWidget({
        containerId: 'forte-payments-widget-container',
        data
      });
    });
    ```
  </Accordion>

  <Accordion title="ForteKycSuccess" icon="circle-check">
    Emitted when the user closes the widget from the **success screen** after completing verification for the requested access level.

    Use this event to unlock features, display a confirmation message, or refresh on-chain state in your UI.
  </Accordion>

  <Accordion title="ForteKycFailure" icon="circle-xmark">
    Emitted when the user closes the widget from the **failure screen** after an unsuccessful verification attempt.

    Use this event to display a fallback message or prompt the user to try again later.
  </Accordion>

  <Accordion title="FortePaymentsWidgetClosed" icon="person-to-door">
    Emitted when the user closes the widget **before completing verification** — from any screen that is not a terminal success or failure screen.

    <Info>
      Verification flows are resumable. Previously provided information is retained — the user will not need to re-enter it when they re-open the widget.
    </Info>
  </Accordion>
</AccordionGroup>

***

## Event Listener Snippet

Add event listeners **before** the script that loads the Forte widget.

```javascript theme={null}
window.addEventListener('FortePaymentsWidgetLoaded', () => {
  window.initFortePaymentsWidget({
    containerId: 'forte-payments-widget-container',
    data
  });
});

window.addEventListener('ForteKycSuccess', function(event) {
  console.log('Verification complete');
  // e.g. unlock feature, show "Access Granted" toast
});

window.addEventListener('ForteKycFailure', function(event) {
  console.log('Verification failed');
  // e.g. display retry prompt
});

window.addEventListener('FortePaymentsWidgetClosed', function(event) {
  console.log('Widget closed before completion');
  // e.g. re-show the verification prompt
});
```

***

## Authoritative Access Level Confirmation

Client-side events are UI signals, not on-chain state. Before gating features or granting access, query the ACL contract directly to confirm the wallet's verified level.

<Card title="ACL Contract" icon="file-contract" href="/acl_contract">
  Query on-chain access levels via the Forte ACL smart contract
</Card>
