AI chatbot for React
Copy one small component, render it once near the root, and your app has an agent trained on your own content. No package to install, and a JavaScript API when you need control.
- One component
- No package to install
- Free plan to start
Made for React apps
This is for teams with a React single-page app, built with Vite, Create React App or similar, who want a help chat that answers from their own docs and site.
The component is a few lines that load our script once. You own the code, there's no dependency to update, and the widget keeps its conversation while your app changes route.
Install on React, step by step
Create your agent first: paste your website's address and it reads your pages. Then add it to your site.
Add the component
- 1Create your agent: paste your website URL and let it read your pages.
- 2Add ReplyBashWidget.tsx with the code below (your dashboard fills in your agent key).
- 3Render it once, near the root of your app, for example in App.tsx.
- 4Deploy, or run the app locally, and ask a question you know the answer to.
// ReplyBashWidget.tsx: render <ReplyBashWidget /> once, e.g. in App.tsx.
// (Or paste the script tag from "Script tag" into index.html instead.)
import { useEffect } from "react"
export function ReplyBashWidget() {
useEffect(() => {
if (document.querySelector('script[src="https://replybash.com/embed.js"]')) return
const script = document.createElement("script")
script.src = "https://replybash.com/embed.js"
script.dataset.agentId = "YOUR_AGENT_KEY"
script.defer = true
document.body.appendChild(script)
}, [])
return null
}Prefer no component? Paste the script tag into index.html instead; it does the same. Other ways to install, such as the chat inside one page, are in the quickstart.
What works on your site
Every feature below is built and in the product today.
Stays put between routes
Render it once and the chat stays mounted while your app changes page. If a re-render removes it, it comes back with the open conversation.
Test on localhost
Allow localhost is on by default, so it loads on localhost and 127.0.0.1 on any port while you build.
Control it from code
replybash("open"), "close", "toggle", "hide" and "show" from anywhere in your app.
Events for your analytics
Listen for widget-opened, user-message, conversation-started or form-submitted and send them on.
Hide it on some routes
Page rules decide where it shows, checked on every navigation, or call hide and show yourself.
Clean up on logout
replybash("reset") clears the conversation when a user signs out, even before the chat has loaded.
Your website
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