How can we help? 👋

How to add testimonials to Svelte

How to add your testimonials to your Svelte app.

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 and get the embed code snippet

In Senja:

Create a testimonial widget. To create a widget, go to the Studio

Notion image
 

On the studio page, navigate to the Widgets section and select Start from scratch

Notion image

Name your widget and click Create widget

Notion image

Click the + button

Notion image

You can choose between Approved testimonials and Curate Testimonials. In this example, we selected the Approved Testimonials option so testimonials matching the filters will be added automatically:

Notion image

Select a widget style and customize the design until you’re happy. Then click Share on the top right:

Notion image

Copy your widget’s code by clicking on the copy icon

 
Notion image
 

Want a faster way to grab your widget code? Use Senja’s Chrome Extension

Senja’s free Chrome Extension allows you to copy your widget code and form URLs, and see all your latest testimonials, all without leaving the page you’re on. Download it free here.

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"
  ></div>
  <script
    async
    type="text/javascript"
    src="https://static.senja.io/dist/platform.js"
  ></script>
</div>
⚠️
NOTE: You can not add multiple top level scripts to a Svelte file. Make sure your Senja embed code is wrapped in at least one element and/or DIV.

Once you do this, your Senja widget will be rendered on the page.

Notion image
💡
That’s it, your testimonial widget is now embedded in your Svelte app 🥳 Not working? Just click Contact Us below and we’ll assist you.
 
Did this answer your question?
😞
😐
🤩