SvelteKit

Feedback widget
for SvelteKit.

Mount in +layout.svelte under a browser guard. SSR-safe, adapter-agnostic.

SvelteKit prerenders by default, so widget initialization belongs inside an onMount on the client. Place it in your top-level +layout.svelte and every route inherits it.

~12kb
gzipped
0
config
MIT
license
Install2 steps
> ~ install· bash
npm install @usero/sdk
> src/routes/+layout.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 SvelteKit

Why teams shipping with SvelteKit pick Usero.

SSR-safe by construction

onMount only runs in the browser. SvelteKit prerendering, SSR, and SPA modes all behave the same way.

Adapter-agnostic

adapter-cloudflare, adapter-vercel, adapter-node, adapter-static. The widget runs only client-side, so the adapter does not matter.

Survives client-side navigation

Mounted in the root +layout.svelte, the widget stays alive through every goto() and form submission.

Pairs with $page metadata

Pass metadata: { route: $page.route.id } to tag every submission with the route the user was on.

Featurebase requires a script src in app.html and a separate init call. Usero is one import inside +layout.svelte.
vs Featurebase script

FAQ

Quick answers, SvelteKit edition.

Will this break prerendering?

No. onMount does not execute during prerender. The widget code is treeshaken from the server bundle.

Where should I put it in a route group layout?

The top-level +layout.svelte is fine. Putting it in a deeper layout means it remounts when you navigate out of that group.

Does it work with adapter-cloudflare?

Yes. The widget runs in the browser, not on the Worker, so the adapter is irrelevant to it.

Can I read the current page in widget metadata?

Yes. Import { page } from '$app/state' and pass metadata: { route: page.route.id }.

Ship a feedback widget in your SvelteKit app today.

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

Get started free