CustomEvents named sleek:{event} on document. $sleek.on() is a thin wrapper around addEventListener for those, so you can log an open, forward a submitted post to your own analytics, or react when a user signs in.
Register a listener
Call$sleek.on(event, callback). The callback receives the CustomEvent, and any payload is on event.detail.
function
required
Receives the
CustomEvent. Read the payload from event.detail, never from the first argument directly.shutdown(). If you need to detach one, register it with document.addEventListener yourself and keep the reference for removeEventListener.
Listen before the SDK loads
$sleek.on() only exists once the SDK script has run. To catch the earliest events, including init, use the native API with the sleek: prefix. This works from anywhere on the page, before or after the snippet.
Event reference
Lifecycle
loaded and widget_init both mark the iframe being ready, reported from the two sides of it. The iframe is only built the first time the widget is opened, so neither fires on a page where the visitor never opens the widget.Navigation
view is the widget’s route with the leading slash dropped, matching the view strings open() takes: feedback, feedback.48121, changelog, notifications, popup.satisfaction. The home screen reports an empty string. query is the route’s query parameters as an object.
Authentication
Submissions
Popups
Capture tool
Use
$sleek.loadTool() rather than these events directly; it handles both outcomes in one callback.
Examples
Track widget usage
Sync your own UI with the signed-in user
Handle a failed sign-in
SDK overview
Every method on
$sleek, including push_trigger() for dispatching your own events.Webhooks
Server-side notifications for the same activity, delivered to your backend.
