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.
npm install @usero/sdk<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
onMount only runs in the browser. SvelteKit prerendering, SSR, and SPA modes all behave the same way.
adapter-cloudflare, adapter-vercel, adapter-node, adapter-static. The widget runs only client-side, so the adapter does not matter.
Mounted in the root +layout.svelte, the widget stays alive through every goto() and form submission.
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.
FAQ
No. onMount does not execute during prerender. The widget code is treeshaken from the server bundle.
The top-level +layout.svelte is fine. Putting it in a deeper layout means it remounts when you navigate out of that group.
Yes. The widget runs in the browser, not on the Worker, so the adapter is irrelevant to it.
Yes. Import { page } from '$app/state' and pass metadata: { route: page.route.id }.
Free tier. No credit card. Two-minute install. Cancel by deleting two lines of code.
Install guides