TheDocumentation Index
Fetch the complete documentation index at: https://sleekplan.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
$sleek object is the global entry point for all programmatic control over the Sleekplan widget — opening views, hiding the launcher, and managing the session lifecycle from your own JavaScript. For identifying your users, see User setup; for reacting to widget events, see Events; for popup-specific triggers, see Popups.
Widget controls
Open the widget
$sleek.open(view, callback) opens the widget. Without arguments it opens the home screen. Pass a view string to jump directly to a specific screen, and an optional callback that fires once the view is rendered.
| View | Description |
|---|---|
home | Default home screen with the feedback item list |
feedback.add | Opens the new feedback submission form |
feedback.{ID} | Opens a specific feedback item — replace {ID} with the item’s numeric ID |
changelog | Opens the changelog view |
notifications | Opens the notification list for the current user |
popup.update.{ID} | Displays a specific update popup by ID |
Close the widget
$sleek.close() hides the widget if it is currently open. It does not remove the widget from the page.
Toggle the widget
$sleek.toggle(view) alternates between open() and close(). Pass an optional view string to open to a specific screen when the widget is closed.
Show and hide the launcher button
Use$sleek.showButton() and $sleek.hideButton() to control the default launcher button independently of the widget itself.
Shut down the SDK
$sleek.shutdown() fully removes the SDK from the page. It performs three actions:
- Clears all user data and resets the session
- Unbinds all custom event listeners
- Removes the widget from the DOM
HTML attributes (no-code triggers)
Widget triggers
Add these attributes to any clickable element — button, link, or otherwise — to open the widget when the element is clicked.Badge counters
Attach these attributes to any element to have the SDK automatically populate it with the current notification count.data-count attribute value on the element; style and display it however you like in your CSS.
SPA support and rebinding
The SDK observes browser history changes and rebinds HTML attribute triggers automatically for most single-page application (SPA) frameworks. If you dynamically insert new elements withdata-sleek-* or data-badge-* attributes after the initial page load, call $sleek.rebind() to register them.
Advanced configuration
Set these globals before the SDK script tag to customize its behavior.window.SLEEK_SETTINGS
Merge or override widget settings client-side. Also accepts a session object forwarded during session initialization.
window.SLEEK_COOKIE_DOMAIN
Force the cookie domain the SDK uses. This is useful when your app spans multiple subdomains and you want a single shared session.
window.SLEEK_DATA
Extend product data that the SDK fetches from the backend. This is rarely needed and intended for advanced use cases only.
Storage behavior
The SDK selects its storage mechanism in this order:localStorage(preferred)- Cookies (fallback)
- In-memory store (last resort — sessions do not persist across page reloads)
In highly restricted browser environments (strict content security policies, ad blockers), both
localStorage and cookies may be unavailable. The SDK will still function within the session using its in-memory store, but user sessions will not persist between page reloads.User setup
Identify your users with
$sleek.setUser() and manage session data.Events
Listen to widget lifecycle and authentication events with
$sleek.on().