First grab your snippet from Settings → Widget and copy your
SLEEK_PRODUCT_ID. See Install the Sleekplan widget for the basics.Function components (hooks)
Add the widget from auseEffect hook in your top-level component (for example App). The empty dependency array [] makes it run once, right after the first render.
YOUR_PRODUCT_ID with the numeric ID from your snippet (leave it unquoted, it is a number).
Class components
If you still use class components, put the same code incomponentDidMount() so it runs after the component is on the page:
Next.js
In Next.js, use the built-inScript component in your root layout so the snippet loads once across route changes. Give it the afterInteractive strategy and set your product ID before the SDK loads.
Identify your users
Once the widget loads you can attach your signed-in user with the SDK, for example after login:Next steps
Back to install overview
The snippet, user identification, and other platforms.
Content Security Policy
Allowlist the Sleekplan domains if your app enforces a CSP.
