chatty4allBuild your assistant

Install the chatbot with your AI coding assistant

Updated · 3 min read

If your website lives in a code project and you work with an AI coding assistant (Cursor, Claude, Lovable, v0, Bolt or similar), you don't need to work out where the chatbot's code goes. Chatty4All gives you a ready-made prompt: paste it into your assistant and it adds the chatbot in the right place for your stack.

Get your prompt

  1. Publish your assistant in the editor, after adding your site under Go live → Websites it may run on.
  2. In Go live, choose the Your AI assistant tab.
  3. Copy the prompt. It already contains your snippet with your own assistant id.

What the prompt says

Here it is for the floating bubble, with YOUR_BOT_ID where your id goes. The editor also has a version for the inline layout.

Prompt
Add the Chatty4All chat assistant to this website. It is one script tag; change nothing else.

The snippet (keep src and data-bot exactly as written):

<script src="https://chatty4all.design/widget.js" data-bot="YOUR_BOT_ID" async></script>

It adds a chat button in the corner of every page that loads it.

1. Work out how this site is built, then put the snippet in the one place that loads on every page:
   - Plain HTML: just before </body> (in the shared footer if there is one, otherwise on each page).
   - Next.js: in app/layout (or pages/_app) with next/script: import Script from "next/script"; then <Script src="https://chatty4all.design/widget.js" data-bot="YOUR_BOT_ID" strategy="afterInteractive" />
   - React / Vite / other single-page apps: in index.html, just before </body>.
   - WordPress: the theme's footer.php just before </body>, or a header & footer code plugin.
   - Shopify: layout/theme.liquid, just before </body>.
   - Wix, Squarespace or Webflow: there is no file to edit; tell me to paste the snippet into the site's custom code / footer code injection setting.
2. Add it only once. Search the project for widget.js and data-bot first and remove any older copies.
3. If the site sets a Content-Security-Policy (meta tag, server headers or middleware), add https://chatty4all.design to script-src and frame-src. Don't loosen anything else.
4. The assistant only runs on the websites allowed in its Chatty4All settings (Go live → Websites it may run on). If it says it isn't enabled for this site, tell me to add the domain there; don't work around it.
5. Check it worked: run the site, open a page and confirm the chat launcher appears (or the chat itself, for the in-page layout) with no errors in the browser console. Then tell me which file you changed.

It tells your assistant to:

  • work out how the site is built, and put the snippet in the one place that loads on every page (with the exact place for plain HTML, Next.js, React and Vite, WordPress and Shopify);
  • add it only once, removing older copies;
  • allow our address in a Content-Security-Policy if the site has one, without loosening anything else;
  • not work around the website lock, but tell you to add the domain;
  • check the chat appears with no console errors, and tell you which file it changed.

Review the change

It should be a one- or two-line change. Look at the diff before you accept it: the snippet's src and data-botshould match the editor exactly, and nothing else in your project should change. Then deploy your site the way you normally do.

When a prompt isn't the right tool

Site builders such as Wix, Squarespace and Webflow have no code file for the assistant to edit, so the prompt tells it to hand the job back to you. Use the step-by-step guides for Wix, Squarespace or Webflow instead.