Coming soonYour agent on WhatsApp, Messenger and Instagram
ReplyBash

AI chatbot for Next.js

Add one <Script> to your root layout and every route has an agent that answers from your own content. It loads after your page, with the App Router or the Pages Router.

  • next/script in your layout
  • App Router and Pages Router
  • Free plan to start
Who it's for

Made for Next.js apps

This is for teams running a marketing site or an app on Next.js who want visitors' questions answered from their own pages, docs and files.

It's one tag in the root layout, so every route gets the chat without touching your pages. There's no package to add and nothing to build.

Install

Install on Next.js, step by step

Create your agent first: paste your website's address and it reads your pages. Then add it to your site.

Add it to your root layout

  1. 1Create your agent: paste your website URL and let it read your pages.
  2. 2Add the <Script> below to app/layout.tsx, after {children}. With the Pages Router, add the same <Script /> to pages/_app.tsx.
  3. 3Deploy, or run next dev, and ask a question you know the answer to.
app/layout.tsx
// app/layout.tsx (Pages Router: add the same <Script /> to pages/_app.tsx)
import Script from "next/script"

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://replybash.com/embed.js"
          data-agent-id="YOUR_AGENT_KEY"
          strategy="lazyOnload"
        />
      </body>
    </html>
  )
}

Preview deployments have their own addresses: add them in Embed › Allowed domains, where *.yourdomain.com covers every subdomain. Other ways to install, such as the chat inside one page, are in the quickstart.

On Next.js

What works on your site

Every feature below is built and in the product today.

  • Loads after your page

    strategy="lazyOnload" lets your page finish loading before the chat script starts.

  • One place for every route

    In the root layout, the chat is on every route and keeps its conversation as visitors move around.

  • Both routers

    The App Router takes it in app/layout.tsx; the Pages Router in pages/_app.tsx.

  • Local and preview testing

    It loads on localhost by default, and on preview addresses once you add them to Allowed domains.

  • Only where you want it

    Page rules show it on some paths only, or call replybash("hide") from a client component.

  • Answers with sources

    Every answer comes from your pages and files, and website answers show the page they used.

FAQ

Next.js questions

Something else? We answer every email.

Email us

Both. With the App Router the <Script> goes in app/layout.tsx; with the Pages Router the same <Script /> goes in pages/_app.tsx.

No. next/script works in the server layout, exactly as the snippet shows. You only need a client component to call replybash(...) yourself.

The chat only loads on allowed domains. Add the preview address, or a *.yourdomain.com wildcard, in Embed › Allowed domains.

Yes. Use page rules to show it only on some paths, or call replybash("hide") on the pages where it shouldn't be.

No package to install. The widget and its JavaScript API are all you need today; an HTTP API is planned.

The chat works on every plan, the Free plan included, which has 100 messages a month. Paid plans start at $39 a month with a 7-day free trial.

Put your website to work tonight

Paste your URL and chat with your agent in minutes.

Free for 100 messages a month · No credit card required