index.html is the simplest and works for both Vue 2 and Vue 3. Injecting it from a component gives you more control if you need to load it conditionally.
First grab your snippet from Settings → Widget and copy your
SLEEK_PRODUCT_ID. See Install the Sleekplan widget for the basics.Option 1: Add to index.html (recommended)
In a Vue project created with Vite or Vue CLI, open theindex.html file in your project’s public folder (or the project root for Vite). Paste the snippet just before the closing </head> tag:
YOUR_PRODUCT_ID with the numeric ID from your snippet. Because it loads asynchronously, it will not block your app from rendering.
Option 2: Inject from your root component
If you would rather keep the snippet out ofindex.html, or you need to load the widget only for certain users, inject it from the mounted hook of your root component (App.vue). This runs once, after the app is on the page.
onMounted():
Nuxt
For a Nuxt app, add the script throughnuxt.config so it loads on every page:
Identify your users
After the widget loads, attach your signed-in user with the SDK: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.
