Add an AI agent to a Next.js, React, Vue or Angular app

Updated November 1, 2026

In Next.js, add the script once with the Script component in the root layout. In React, Vue or Angular, paste it inside <head> of index.html. Page changes inside the app are handled for you.

Single-page apps need the script only once. Moving between pages inside your app is handled automatically: the chat stays open, the conversation is kept, and the agent knows which page the user is on.

Next.js Script component in the root layout and the script tag in index.html for React, Vue or Angular
Add it once; page changes inside the app keep the chat open.

Next.js

In Next.js, use the Script component instead of a plain <script> tag. Pick Next.js in the install window to get this code:

The install window with Next.js selected
Pick Next.js: the code uses the Script component.
import Script from "next/script"

// Inside the root layout's <body>, once:
<Script id="agentguide" src="https://agentguide.site/api/embed/script.js?embedId=YOUR_EMBED_ID" strategy="afterInteractive" />
  1. Open your root layout: app/layout.tsx (Pages Router: pages/_app.tsx).
  2. Add the code once.
  3. Deploy.

React, Vue or Angular

The install window with React / Vue / Angular selected
Pick React / Vue / Angular.
  1. Open index.html (in public/ or the project root).
  2. Paste the code inside <head>.
  3. Deploy.
<script src="https://agentguide.site/api/embed/script.js?embedId=YOUR_EMBED_ID" async></script>

Show the agent inside your signed-in app

A Support agent works best inside your app, where Guide Me can point to the real buttons. Two optional extras for developers:

  • Identify signed-in users, so each customer sees their own conversation on every device.
  • Track outcomes such as signups or purchases with AgentGuide.track(name); results appear under Analytics → Outcomes.

If your app sends a strict Content-Security-Policy, see Allow AgentGuide in a Content Security Policy.

Get started

Put your first agent on your website today.

Start free. Add your website or documents, pick Sales or Support, and watch it answer your customers.

  • Free plan, no credit card
  • Answers from your own content
  • Sales, Support, or both