For developers

Install on a React, Next.js or Vue site

Load the script once for the whole app. Client-side navigation is supported: when the URL changes, widgets re-check their display rules, and stories blocks fill in as soon as they appear on the page.

  1. 1

    Vite, Create React App and plain HTML

    Paste the line into index.html right before the closing </body> tag.

    <script src="https://swoopkit.app/loader.js" data-site="SITE_KEY" async></script>
  2. 2

    Next.js (App Router)

    Add the script inside <body> in your root app/layout.tsx.

    import Script from "next/script";
    
    <Script src="https://swoopkit.app/loader.js" data-site="SITE_KEY" strategy="afterInteractive" />
  3. 3

    Nuxt

    Add the script in nuxt.config.ts.

    app: {
      head: {
        script: [{ src: "https://swoopkit.app/loader.js", "data-site": "SITE_KEY", async: true, tagPosition: "bodyClose" }],
      },
    },

If you use stories “on the page”

You don't need this for the button, banners or floating stories. Each stories widget has its own block code, you'll find it in the editor under Publish.

  1. 4

    Add an empty element to your markup

    In your JSX or component template. Don't give it children: the script adds the content.

    <div data-vzhuh="WIDGET_ID" />

✓ Check it

Open your site in a new tab. Once someone visits a page with the code, your Swoopkit dashboard shows a green “Code installed” mark.

Can't add the code? We'll install it for free

Write to our support team and we'll help or do it for you

Contact support