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
- Agencies can start with the Marketing Agency Quote Qualifier to capture budget, timeline, and scope before a call.
- Studios can deploy the Portrait & Commercial Photo Studio Booker to answer package and turnaround FAQs 24/7.
Ready to launch? Compare one-time kits and 5-site agency packs on the pricing page.