WisebotAI
Integrations

Widget integration

Add the WisebotAI chat widget to any website — HTML, React, Next.js, JavaScript, and Framer.

Widget integration

The WisebotAI widget is a floating chat bubble you drop into any website with a single script tag. It loads the full chat experience inside an iframe so it never conflicts with your page styles.

Step 1 — Get your IDs

Open Dashboard → Integrations (/integrations). You need two values:

ValueWhere to find it
Organization IDShown in the Integrations page, copy button on the right
Agent IDShown below the Organization ID — matches the agent selected in the top navbar

Select the agent you want to power the widget before copying the IDs.


Step 2 — Add the snippet

Pick the platform your site uses.

PlatformWhere to paste
HTMLBefore </body>
JavaScriptDynamic script injection
ReactuseEffect in a root component
Next.js (layout)next/script in app/layout.tsx
Next.js (page)next/script in a specific page.tsx
Next.js (Pages Router)next/script in pages/_app.tsx
FramerSite settings → Custom Code → End of body
Shopifylayout/theme.liquid before </body>
WordPressfunctions.php or Header & Footer plugin
WebflowSite settings → Custom code → Footer
WixSettings → Advanced → Custom Code → Body end
SquarespaceSettings → Advanced → Code Injection → Footer

HTML

Paste before the closing </body> tag on every page you want the widget to appear.

<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

JavaScript (vanilla)

Use this when you need to load the widget dynamically or control when it initializes.

(function () {
  var script = document.createElement("script");
  script.src = "https://widget.wisebotai.com/widget.js";
  script.async = true;
  script.setAttribute("data-organization-id", "YOUR_ORGANIZATION_ID");
  script.setAttribute("data-agent-id", "YOUR_AGENT_ID");
  document.body.appendChild(script);
})();

// Optional controls once loaded:
// window.WisebotWidget.show()
// window.WisebotWidget.hide()
// window.WisebotWidget.destroy()

React

Add once near the root of your app (e.g. App.tsx or App.jsx). The useEffect cleanup removes the script when the component unmounts.

import { useEffect } from "react";

export function WisebotWidget() {
  useEffect(() => {
    const script = document.createElement("script");
    script.src = "https://widget.wisebotai.com/widget.js";
    script.async = true;
    script.setAttribute("data-organization-id", "YOUR_ORGANIZATION_ID");
    script.setAttribute("data-agent-id", "YOUR_AGENT_ID");
    document.body.appendChild(script);

    return () => {
      window.WisebotWidget?.destroy?.();
      script.remove();
    };
  }, []);

  return null;
}

// Render <WisebotWidget /> once near the root of your app:
// <App>
//   <WisebotWidget />
//   ...
// </App>

Next.js — App Router

There are two ways depending on whether you want the widget on every page or only a specific page.

Add next/script inside your root <body>. The afterInteractive strategy loads it after hydration without blocking render.

// app/layout.tsx
import Script from "next/script";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://widget.wisebotai.com/widget.js"
          strategy="afterInteractive"
          data-organization-id="YOUR_ORGANIZATION_ID"
          data-agent-id="YOUR_AGENT_ID"
        />
      </body>
    </html>
  );
}

page.tsx — widget on one specific page

Use this when you only want the widget on, say, a support or pricing page.

// app/support/page.tsx
import Script from "next/script";

export default function SupportPage() {
  return (
    <>
      <main>
        {/* your page content */}
      </main>
      <Script
        src="https://widget.wisebotai.com/widget.js"
        strategy="afterInteractive"
        data-organization-id="YOUR_ORGANIZATION_ID"
        data-agent-id="YOUR_AGENT_ID"
      />
    </>
  );
}

Note: Do not place a raw <script> tag as a direct child of <html>. Always use next/script — Next.js 13+ will throw an error otherwise.


Next.js — Pages Router (_app.tsx)

// pages/_app.tsx
import type { AppProps } from "next/app";
import Script from "next/script";

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <Component {...pageProps} />
      <Script
        src="https://widget.wisebotai.com/widget.js"
        strategy="afterInteractive"
        data-organization-id="YOUR_ORGANIZATION_ID"
        data-agent-id="YOUR_AGENT_ID"
      />
    </>
  );
}

Framer

  1. Open your Framer project.
  2. Go to Site settings (top toolbar) → GeneralCustom Code.
  3. Paste the snippet into the End of <body> field.
  4. Click Publish and open the live URL to verify.
<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

Shopify

  1. In your Shopify admin go to Online Store → Themes → Edit code.
  2. Open layout/theme.liquid.
  3. Paste the snippet just before the closing </body> tag.
  4. Click Save and reload your storefront.
{% comment %} theme.liquid — paste before </body> {% endcomment %}
<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

WordPress

Option A — functions.php (recommended for developers):

  1. Go to Appearance → Theme File Editor (or use a child theme).
  2. Open functions.php and paste at the bottom.
  3. Save and visit your site.
<?php
function wisebot_widget() {
  ?>
  <script
    src="https://widget.wisebotai.com/widget.js"
    data-organization-id="YOUR_ORGANIZATION_ID"
    data-agent-id="YOUR_AGENT_ID"
  ></script>
  <?php
}
add_action( 'wp_footer', 'wisebot_widget' );

Option B — Header & Footer plugin (no-code):

  1. Install a plugin like Insert Headers and Footers or WPCode.
  2. Paste the <script> tag into the Footer section.
  3. Save and verify.
<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

Webflow

  1. In the Webflow Designer open Site settings → Custom code.
  2. Paste the snippet into the Footer code field.
  3. Click Save changes, then Publish.
<!-- Webflow: Site settings → Custom code → Footer code -->
<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

Wix

  1. In the Wix dashboard go to Settings → Advanced → Custom Code.
  2. Click + Add Custom Code, paste the snippet.
  3. Set placement to Body — End and apply to All Pages.
  4. Publish the site.
<!-- Wix: Settings → Advanced → Custom Code → Body - end -->
<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

Squarespace

Requires Business plan or above — Code Injection is not available on Personal plans.

  1. Go to Settings → Advanced → Code Injection.
  2. Paste the snippet into the Footer field.
  3. Click Save.
<!-- Squarespace: Settings → Advanced → Code Injection → Footer -->
<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
></script>

Configuration attributes

All attributes are set on the <script> tag (or via setAttribute in JS).

AttributeRequiredDefaultDescription
data-organization-idYesYour workspace ID
data-agent-idYesAgent that handles conversations
data-positionNobottom-rightbottom-right · bottom-left · top-right · top-left
data-widthNo400pxWidget width on desktop
data-heightNo600pxWidget height on desktop
data-mobile-widthNocalc(100vw - 40px)Widget width on mobile
data-mobile-heightNocalc(100vh - 110px)Widget height on mobile
data-animationNononeBubble animation: bounce · pulse · ping · spin · none

Example with options:

<script
  src="https://widget.wisebotai.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
  data-agent-id="YOUR_AGENT_ID"
  data-position="bottom-left"
  data-width="380px"
  data-height="640px"
  data-animation="pulse"
></script>

JavaScript API

After the script loads, window.WisebotWidget exposes these methods:

window.WisebotWidget.show()     // open the chat window
window.WisebotWidget.hide()     // close the chat window
window.WisebotWidget.destroy()  // remove the widget from the page
window.WisebotWidget.init({     // reinitialize with new config
  organizationId: "...",
  agentId: "...",
  position: "bottom-left",
})

Example — open on button click:

<button onclick="window.WisebotWidget.show()">
  Chat with us
</button>

Troubleshooting

Widget not appearing

  • Check the browser console for errors (wrong org/agent ID, CORS, mixed content).
  • Make sure the script URL is https:// — HTTP will be blocked on HTTPS pages.
  • Confirm data-organization-id and data-agent-id are correct.

Widget hidden behind other elements

  • The widget uses z-index: 999999. If your page has elements with a higher z-index inside a new stacking context, the widget may appear behind them.

Next.js hydration warning

  • Use next/script with strategy="afterInteractive". Never use a raw <script> tag inside <html> or as a sibling of <body>.

Widget loads but shows a blank iframe

  • Verify NEXT_PUBLIC_WIDGET_URL is set correctly in your Vercel environment.
  • Check that widget.wisebotai.com is reachable from the browser.