Skip to content
ZavienGPT

Install guide · React and Next.js

Add an AI chatbot to React and Next.js

The widget is one script tag, so it works in any React app. In Next.js, load it with next/script in your root layout so it's on every route.

The ZavienGPT chat widget open on a website, with suggested questions and colour options

Add the chat widget in 4 steps

  1. Copy your snippet

    In your ZavienGPT dashboard, open Settings → Channels → Chat widget → Installation, and choose Copy code. The snippet already contains your organisation's ID.

  2. Load the script in your root layout

    In Next.js, add <Script src="https://widget.zaviengpt.com/widget.js" data-organization-id="YOUR_ORGANIZATION_ID" strategy="lazyOnload" /> from next/script to app/layout.tsx (or pages/_app.tsx).

  3. Or add it to your HTML template

    In a React app without Next.js, paste the snippet before </body> in public/index.html (or index.html with Vite).

  4. Deploy

    Deploy as usual. The widget follows your visitors from route to route, since the script loads once.

One snippet. Live in minutes.

Paste one line before the closing body tag of your site and the chat widget appears on every page. Colours, greeting, office hours and the AI agent are all set from your dashboard, with no more code.

Get your snippet
<script
  async
  src="https://widget.zaviengpt.com/widget.js"
  data-organization-id="YOUR_ORGANIZATION_ID"
></script>

Check it's working

  1. Open your site in a new window

    Visit any page of your live site. The chat launcher appears in the corner within a few seconds.

  2. Send a test message

    Ask a question your knowledge base covers. The AI agent answers, and the conversation shows up in your inbox.

React and Next.js questions, answered.

WordPress

Add the chat widget to every page of your WordPress site with a free header-and-footer plugin, so it stays in place when your theme updates.

Install on WordPress

Shopify

Add the chat widget to your Shopify theme so shoppers can ask about shipping, returns and sizing on every product page and at checkout's door.

Install on Shopify

Wix

Wix lets you add a script to every page from your site's settings. Paste the snippet there once and the widget shows across your site.

Install on Wix

Live on your site in minutes

Start freeAll install guides