logo

How to Install FastBots on a Website Built With Sanity (Headless CMS)

Follow these simple steps to install your chatbot on a site built with Sanity.

1

How to Get Your FastBots Chatbot Code

Before installing your chatbot on any platform, you’ll need your widget code.

Log in to FastBots.

Select the chatbot you want to install.

Click Deploy in the left-hand menu.

Scroll to Add to a Website.

Copy the script code using the copy icon.

You’ll paste this code into your website builder so the chatbot appears across all pages.

**How to Get Your FastBots Chatbot Code**

Before installing your chatbot on any platform, you’ll need your widget code.

Log in to FastBots.

Select the chatbot you want to install.

Click Deploy in the left-hand menu.

Scroll to Add to a Website.

Copy the script code using the copy icon.

You’ll paste this code into your website builder so the chatbot appears across all pages.
2

Step 1 — Add the script to your frontend project

Sanity is a headless CMS, so the script is added in your frontend code, not inside Sanity Studio.

If your frontend is Next.js:

  1. Open the app/layout.js or pages/_document.js file (depending on your setup).
  2. Inside the <head> section, paste your FastBots script code:

    <script defer src="https://app.fastbots.ai/embed.js" data-bot-id="YOUR-BOT-ID"></script>