Svelte

Feedback widget
for Svelte.

Initialize once in your root onMount. Works with Svelte 4 and Svelte 5 runes.

The vanilla SDK fits Svelte's no-virtual-DOM model perfectly. Boot it from your root component's onMount and the widget lives outside Svelte's reactivity entirely.

~12kb
gzipped
0
config
MIT
license
Install2 steps
> ~ install· bash
npm install @usero/sdk
> src/App.svelte· svelte
<script lang='ts'>
  import { onMount } from 'svelte'
  import { initUseroFeedbackWidget } from '@usero/sdk'

  onMount(() => {
    const widget = initUseroFeedbackWidget({ clientId: 'YOUR_CLIENT_ID' })
    return () => widget.destroy()
  })
</script>

<slot />

Replace YOUR_CLIENT_ID with the id from your Usero dashboard.

Built for Svelte

Why teams shipping with Svelte pick Usero.

No Svelte adapter required

The vanilla SDK is plain JavaScript. Svelte 4, Svelte 5 with runes, and SvelteKit all consume the same package.

Lives outside the Svelte tree

The widget renders into its own DOM root, so component updates and store changes never trigger a widget re-render.

Tiny by Svelte standards

~12kb gzipped is small compared to typical Svelte page weights, and it is shared across every route.

HMR clean

Returning a teardown from onMount means hot reloads do not leak triggers into the DOM.

Productboard expects a full embed page. Usero is a 12kb script that sits on top of your existing UI.
vs Productboard portal

Verify

Confirm it's working.

  1. Run your Vite dev server and open the app.

  2. Confirm the feedback bubble appears bottom-right after the root component mounts.

  3. Click it and check the panel opens over your Svelte UI.

  4. Submit a test message and confirm it lands in your Usero inbox.

  5. Reload a few times and watch the console for leaked triggers or errors.

Troubleshooting

Common problems, Svelte edition.

Nothing renders and the build errors with "document is not defined".

initUseroFeedbackWidget needs the DOM, so call it inside onMount, which only runs in the browser. Do not call it at the top of the <script> block.

It works in pure Svelte but breaks under SvelteKit with an SSR error.

SvelteKit renders on the server first. Guard the init with import { browser } from '$app/environment' and only call it when browser is true, or follow the SvelteKit guide and mount it in +layout.svelte.

Stale bubbles pile up during development.

Return a teardown from onMount: return () => widget.destroy(). Hot module reload re-runs onMount, so without the cleanup each reload leaves an orphaned trigger in the DOM.

The widget remounts every time I navigate.

It is initialized in a page-level component rather than the root. Move it to your top-level App.svelte (or +layout.svelte under SvelteKit) so it survives navigation.

I expected a Svelte component or action to import.

There is not one, and you do not need it. The vanilla function call inside onMount is the idiomatic path. Import initUseroFeedbackWidget from @usero/sdk.

FAQ

Quick answers, Svelte edition.

Does this work with Svelte 5 runes?

Yes. The widget does not interact with Svelte reactivity at all, so $state and runes are unaffected.

Is there a Svelte action or component?

There is no Svelte-specific wrapper because the vanilla SDK is already idiomatic. One import, one function call.

What about SSR in SvelteKit?

Use the SvelteKit guide. For pure Svelte (vite-svelte) there is no SSR concern.

Can I theme the widget to match my Svelte UI?

Yes. Pass a theme object with your brand colors when initializing.

Ship a feedback widget in your Svelte app today.

Free tier. No credit card. Two-minute install. Cancel by deleting two lines of code.

Get started free