How to add testimonials to Svelte
Adding Senja to your Svelte app is extremely simple and requires no extra dependencies or configuration. Here's how to do it:
Create your widget
First, you'll need to create a widget in Senja. Learn how to turn your testimonials into a widget
Paste the embed code into your Svelte component
Open the +page.svelte file (if you're working with SvelteKit), or the Svelte component you want to embed your testimonials in
Paste the Senja embed code:
<div>
<div
class="senja-embed"
data-id="4ac65b64-922c-4daf-af40-5cf71ade893f"
data-lazyload="false"
data-mode="shadow"
></div>
<script
async
type="text/javascript"
src="https://static.senja.io/dist/platform.js"
></script>
</div> You cannot add multiple top level scripts to a Svelte file. Make sure your Senja embed code is wrapped in at least one element or div
Once you do this, your Senja widget will be rendered on the page
That's it, your testimonial widget is now embedded in your Svelte app 🥳 Not working? Contact support and we'll assist you
Was this helpful?