What is a React chatbot widget?+
The phrase covers two different things. One is a UI component library — you install a React package, style the chat interface and connect it to a backend you build yourself, owning the conversation logic and any retrieval. The other is a hosted assistant that already handles all of that and drops into your app as a script tag or a small component. Both are legitimate; they suit opposite situations. This page is the second kind, and the section above names good options for the first.
Does it work with the Next.js App Router?+
Yes. Use next/script with strategy="afterInteractive" in your root layout for a site-wide widget, or in the layout of a route group when only part of the app needs it. Server components are not a problem — the tag is rendered on the server and executed in the browser, so nothing touches document where document does not exist.
Does it work with React 19?+
Yes, and with 17 and 18. Because nothing is installed there is no peer-dependency range to satisfy and no version to keep in step with your app — which is the main practical argument for a script tag over a package.
What does it cost in bundle size?+
Nothing in your bundle. The widget is fetched separately from a CDN after your app is interactive, so it does not enter your build output, does not affect your chunk sizes and should not move your Largest Contentful Paint.
Is there an npm package?+
No, and deliberately so. The integration is a script tag, which means no dependency to version, no peer-dependency conflict with your React version, and no bundle-size cost in your app. The component on this page is the whole “package” — copy it into your codebase and it is yours.
Does it work with TypeScript?+
Yes. The component is plain DOM work; rename it to .tsx and the only annotation you need is none. script.dataset.botId is typed as a string on HTMLScriptElement already.
Can I load it only for signed-in users?+
Yes — render the component behind your auth check. Be aware that once the script has injected the widget, unmounting the component does not remove it, so gate on the first render rather than toggling it during a session.
Does it work in React Native?+
No. This is a web widget that mounts DOM nodes. For mobile, CustomerBot ships its own Android and iOS companion app for managing conversations, and your users can reach the assistant through your web views.
Will it break my hydration?+
No. The widget mounts outside your React root after hydration, so React never sees its nodes and there is nothing to mismatch.
Can I pass user context into the conversation?+
The tag itself takes the bot ID. For answers that depend on a specific user or account, the right mechanism is an API tool: describe your endpoint in plain English, CustomerBot generates the tool schema, and the assistant calls it during the conversation.