Skip to main content
Events let you react to what happens inside the widget — form changes, swap creation and completion, status transitions, and errors. Pass them via the callbacks prop:

Available callbacks

Notes

  • Keep the callbacks object referentially stable — hoist it to module scope or memoize it, otherwise the widget re-initializes its callback wiring on every render.
  • A throwing callback can’t break the widget — every callback invocation is wrapped in try/catch inside the widget.
  • Payloads are typed as unknown in the public package (WidgetCallbacks), so cast to the payload shapes documented on each event page.
  • callbacks.onError reports errors inside a running widget. Failures to load the widget surface through the top-level onError prop instead — see Widget delivery and security.