← All ShelfBot Guides
Webflow & Squarespace Updated 2026-12-01 · 5 min read

How to Embed a 4.7KB Self-Hosted AI Chatbot on Webflow & Squarespace (Zero Speed Loss)

Most chat widgets ship hundreds of kilobytes of JavaScript, inject global CSS that fights your design, and route every visitor message through a vendor you cannot audit. ShelfBot takes the opposite approach: a 4.7KB widget isolated inside a closed Shadow DOM, talking to an endpoint you own on Cloudflare Workers, with your own model API key. This guide shows how to add it to Webflow and Squarespace in about ten minutes without hurting your Core Web Vitals.

Why 4.7KB and Shadow DOM Matter

A widget this small loads with defer, never blocks rendering, and adds no measurable cost to Largest Contentful Paint. Because the UI lives inside a closed Shadow DOM, your site styles cannot break the chat window and the chat styles cannot leak into your Webflow classes or Squarespace template. Visitor messages are rendered as plain text, not HTML, closing the most common cross-site scripting path in chat widgets.

Step 1: Deploy Your Free BYOK Endpoint

Download your kit ZIP and deploy the included Worker to the Cloudflare Workers Free plan (100,000 requests per day). Store your model provider key as an encrypted Worker secret, or keep Workers AI enabled on your Cloudflare free quota. Copy your Worker URL (for example https://shop-bot.your-account.workers.dev/chat) — that URL becomes your data-endpoint.

Step 2: Paste the 1-Line Embed Snippet

<script async src="https://tryshelfbot.com/widget.js" data-endpoint="https://shop-bot.your-account.workers.dev/chat" data-brand="Your Studio" data-color="#059669"></script>

Step 3a: Installing on Webflow

For a site-wide bubble, open Site Settings → Custom Code and paste the snippet into Footer Code, then publish. For a single page, open Page Settings and paste into the page footer code box. Preview on your published staging domain since custom code does not execute inside the Designer canvas.

Step 3b: Installing on Squarespace

Open Settings → Advanced → Code Injection and paste the snippet into Footer (available on Business plans and above), or use a single page's Advanced Code Injection tab. Save and check the live URL in a private window.

Step 4: EU AI Act Article 50 Disclosure

Since 2 August 2026, Article 50 of the EU AI Act requires informing users when they interact with an AI system unless obvious from context. ShelfBot displays a visible AI disclosure badge inside the closed Shadow DOM header automatically so Webflow or Squarespace theme updates cannot hide it.

Step 5: Start With a Ready-Made Trade Template

Ready to launch? Compare one-time kits and 5-site agency packs on the pricing page.

Frequently Asked Questions

Will a chatbot slow down my Webflow or Squarespace site?

Not this one. The widget is 4.7KB, loads asynchronously after first paint, and mounts inside a fixed-position closed Shadow DOM container so it does not affect LCP or layout shift.

Do I need a paid Webflow or Squarespace plan?

Site-wide custom code needs a paid Webflow Site plan or a Squarespace Business plan or higher. The Cloudflare Workers backend itself runs on the free tier.

Does the widget satisfy the EU AI Act transparency rule?

It covers the core Article 50 disclosure baseline by displaying a visible AI badge inside a closed Shadow DOM. You remain responsible for your privacy notice and any other obligations that apply to your business.

Deploy a Pre-Hardened ShelfBot Kit in 10 Minutes

Every $19 kit ships with grounded FAQ JSON, deterministic security guardrails, EU AI Act Art. 50 disclosure badge, 4.7KB async widget, and zero monthly credit fees.

Try Live Sandboxes Now → Buy Any Bot Kit — $19 Compare Plans