OneLineChat

How to add an AI chatbot to a React + Vite app

Open index.html in the project root (not in src/) and paste the script tag just before </body>. The widget sits outside your React tree, so it won't re-render and it doesn't depend on routing.

<body>
  <div id="root"></div>
  <script type="module" src="/src/main.tsx"></script>
  <script src="https://onelinechat.com/widget.js" data-key="olc_pub_YOUR_KEY" async></script>
</body>

Notes

Last updated: · Markdown version