Skip to main content
The Forte Compliance widget emits client-side CustomEvents 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.
Client-side events confirm user action in the widget UI β€” not on-chain state. For authoritative access level confirmation, query the ACL contract directly.

Event Types

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:
window.addEventListener('FortePaymentsWidgetLoaded', () => {
  window.initFortePaymentsWidget({
    containerId: 'forte-payments-widget-container',
    data
  });
});
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.
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.
Emitted when the user closes the widget before completing verification β€” from any screen that is not a terminal success or failure screen.
Verification flows are resumable. Previously provided information is retained β€” the user will not need to re-enter it when they re-open the widget.

Event Listener Snippet

Add event listeners before the script that loads the Forte widget.
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.

ACL Contract

Query on-chain access levels via the Forte ACL smart contract