How to add an AI chatbot to a Lovable app
Lovable projects are React + Vite apps, so the chatbot is one script tag in index.html. The fastest way is to ask Lovable to add it. Get your key at /get-api-key first. It takes your email and nothing else.
Paste this into the Lovable chat
Add this script tag to index.html, just before the closing body tag. Change nothing else. The data-key is public by design, like an analytics ID, so keep it inline in index.html:
<script src="https://onelinechat.com/widget.js" data-key="olc_pub_YOUR_KEY" async></script>
Replace olc_pub_YOUR_KEY with your own key before you send it.
Notes
- Your
*.lovable.apppreview and your published site are both allowed automatically, so you can test in the preview. - The bot reads your published pages. If your app is still private, it answers from the greeting until the site goes live.
- If a later Lovable edit rewrites
index.html, check that the line is still just before</body>.