<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dahye Ahn</title>
    <description>The latest articles on DEV Community by Dahye Ahn (@dahye_ahn_832be7e08ae26fe).</description>
    <link>https://dev.to/dahye_ahn_832be7e08ae26fe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4263927%2F3b89047c-15ab-4203-a5a0-b4f692dfa5a9.png</url>
      <title>DEV Community: Dahye Ahn</title>
      <link>https://dev.to/dahye_ahn_832be7e08ae26fe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dahye_ahn_832be7e08ae26fe"/>
    <language>en</language>
    <item>
      <title>The easy way to let your AI coding agent add a chatbot to your website</title>
      <dc:creator>Dahye Ahn</dc:creator>
      <pubDate>Wed, 25 Nov 2026 06:05:21 +0000</pubDate>
      <link>https://dev.to/dahye_ahn_832be7e08ae26fe/the-easy-way-to-let-your-ai-coding-agent-add-a-chatbot-to-your-website-2njb</link>
      <guid>https://dev.to/dahye_ahn_832be7e08ae26fe/the-easy-way-to-let-your-ai-coding-agent-add-a-chatbot-to-your-website-2njb</guid>
      <description>&lt;p&gt;&lt;em&gt;Works with Cursor, Claude Code, Lovable, Bolt and v0. Last checked: November 2026.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I build most of my side projects with Cursor and Claude Code now. The agent writes the pages, wires up the database, and deploys. Then I say "add a chatbot to the site," and things get clumsy. Either it stops and tells me to sign up somewhere, or it confidently pastes a widget with a made-up ID into the wrong file.&lt;/p&gt;

&lt;p&gt;After doing this a few too many times, I settled on a routine that gets it right on the first try. Here it is, plus what I learned about which chatbot services let the agent do more of the work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclosure up front:&lt;/strong&gt; I'm building a chatbot service for exactly this, &lt;a href="https://onelinechat.com/?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;OneLineChat&lt;/a&gt;. It is early bird yet. Everything in the steps below works with services you can use today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Pick a chatbot your agent can actually finish
&lt;/h2&gt;

&lt;p&gt;To put a working chatbot on a site, an agent needs three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An account or workspace at the chatbot service&lt;/li&gt;
&lt;li&gt;A key or an embed snippet tied to that workspace&lt;/li&gt;
&lt;li&gt;The snippet placed in the right file of your project&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Agents are good at step 3. Steps 1 and 2 are where a person usually has to open a browser. Here's how that looks for the services people usually recommend:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Can the agent get a working key without you opening a dashboard?&lt;/th&gt;
&lt;th&gt;What's still on you&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SiteGPT&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Partly.&lt;/strong&gt; An anonymous CLI or HTTP call returns a token for one chatbot, valid for a 7-day preview&lt;/td&gt;
&lt;td&gt;Claiming the bot with a magic link (and any payment step) to keep it. Their API tokens and MCP tools need the Growth plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chatbase&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Copying the embed script from the dashboard. API keys are created there too, and API v2 starts at the Basic plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chat Data&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An owner or admin creating a workspace key in the dashboard&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tawk.to, Crisp, Tidio, Channel Talk&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Signing up and copying the widget snippet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OneLineChat&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Yes, by design.&lt;/strong&gt; One HTTP call with your email returns a public key and the snippet. &lt;em&gt;Early access for now&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;Just your email&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;SiteGPT&lt;/strong&gt; is the only one I found where the agent can get something running before you touch anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install -g @sitegpt/cli
sitegpt onboarding start https://example.com --json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That returns a workspace ID, a chatbot ID, an API token, and an onboarding URL. There's also a plain HTTP version (&lt;code&gt;POST https://sitegpt.ai/agent/auth&lt;/code&gt; with your &lt;code&gt;websiteUrl&lt;/code&gt;). The token only covers that one chatbot, and the preview expires after seven days. To keep it, you open the onboarding URL and sign in. Their own auth docs say clicking the magic link and any payment step "remain the human's."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OneLineChat&lt;/strong&gt; (mine, see the disclosure above) is built around the same idea, taken one step further. There's no CLI to install and no account to claim. The agent sends one request with your email:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sS -X POST https://onelinechat.com/api/v1/keys \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"email":"you@example.com","site":"https://your-site.com","agent":"claude-code"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once it launches, that call returns a public key and a one-line snippet. &lt;code&gt;localhost&lt;/code&gt; and preview domains work without an allowlist, and the first 100 conversations are free with no card on file. &lt;strong&gt;Today it's early access only.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chatbase&lt;/strong&gt; has a good API, but the key comes from Workspace settings → API keys. Their CLI can log in with &lt;code&gt;chatbase auth login --browser&lt;/code&gt;, where you approve a short code at chatbase.co/activate. You don't need an API key just to show the chat bubble, though. The embed script is under Channels → Chat Bubble → Deploy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tawk.to, Crisp, Tidio and Channel Talk&lt;/strong&gt; are the classic live-chat widgets. Several have free tiers, and they've been around for years. You sign up and copy a snippet. That's one minute of your time, and the agent can do everything after it.&lt;/p&gt;

&lt;p&gt;So for most people the realistic answer is: &lt;strong&gt;you spend one minute getting the snippet, and the agent does the rest.&lt;/strong&gt; The next steps are about making "the rest" go right.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Hand the snippet over with a clear prompt
&lt;/h2&gt;

&lt;p&gt;Most mistakes come from a vague request. This is the prompt I use now:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add this chat widget to my site. Put it in the root layout so it shows on every page, add it only once, and don't change anything else. Use the snippet exactly as given and don't make up any IDs. Here's the snippet from tawk.to:&lt;br&gt;
&lt;code&gt;&amp;lt;paste the snippet&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two rules worth spelling out to the agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Widget IDs and public keys are fine in client code.&lt;/strong&gt; Inline them; no environment variable needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API secrets are not.&lt;/strong&gt; If anything in the snippet is called a secret, it must never go into &lt;code&gt;index.html&lt;/code&gt; or a &lt;code&gt;NEXT_PUBLIC_&lt;/code&gt; / &lt;code&gt;VITE_&lt;/code&gt; variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: Make sure it lands in the right file
&lt;/h2&gt;

&lt;p&gt;This is where agents slip most often. Usually they put the widget in a single page, so it disappears when you navigate. Here's where it should go:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Project&lt;/th&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Next.js App Router (also v0)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;app/layout.tsx&lt;/code&gt;, with &lt;code&gt;next/script&lt;/code&gt; inside &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; after &lt;code&gt;{children}&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next.js Pages Router&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;pages/_app.tsx&lt;/code&gt;, with &lt;code&gt;next/script&lt;/code&gt; after &lt;code&gt;&amp;lt;Component {...pageProps} /&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vite: React, Vue, Svelte (most Lovable and Bolt projects)&lt;/td&gt;
&lt;td&gt;the root &lt;code&gt;index.html&lt;/code&gt;, just before &lt;code&gt;&amp;lt;/body&amp;gt;&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plain HTML&lt;/td&gt;
&lt;td&gt;every page, or the shared footer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;WordPress&lt;/td&gt;
&lt;td&gt;the vendor's plugin, or the Footer box of a header/footer code plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Webflow&lt;/td&gt;
&lt;td&gt;Site settings → Custom code → Footer code (needs a paid site plan)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For Next.js, one detail trips agents up. tawk.to and Crisp give you inline JavaScript, not a &lt;code&gt;src&lt;/code&gt; URL, and an inline &lt;code&gt;next/script&lt;/code&gt; needs an &lt;code&gt;id&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/layout.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Script&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'next/script'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;RootLayout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;children&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReactNode&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"en"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Script&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"chat-widget"&lt;/span&gt; &lt;span class="n"&gt;strategy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"lazyOnload"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sb"&gt;`/* the JavaScript from inside the vendor's &amp;lt;script&amp;gt; tag */`&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're working in Lovable, Bolt or v0 chat rather than an editor, the same prompt from Step 2 works. Just mention the file: "index.html, before the closing body tag" for Lovable and Bolt, or "app/layout.tsx with next/script" for v0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Check that it actually loads
&lt;/h2&gt;

&lt;p&gt;Ask the agent to verify, or do it yourself in two minutes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the site (dev server or preview URL), then DevTools → Network. The vendor's script should return 200.&lt;/li&gt;
&lt;li&gt;Check the Console for "Refused to load" errors. Those mean your &lt;strong&gt;Content-Security-Policy&lt;/strong&gt; blocks the widget. Add the vendor's domains to &lt;code&gt;script-src&lt;/code&gt; and &lt;code&gt;connect-src&lt;/code&gt; (live chat often needs &lt;code&gt;wss:&lt;/code&gt; too), plus &lt;code&gt;img-src&lt;/code&gt;, &lt;code&gt;style-src&lt;/code&gt; or &lt;code&gt;frame-src&lt;/code&gt; as their docs say.&lt;/li&gt;
&lt;li&gt;Navigate to another page. The bubble should still be there, and only once.&lt;/li&gt;
&lt;li&gt;Works in production but not in preview, or the other way round? Some vendors only load on domains you list in their dashboard. Add &lt;code&gt;localhost&lt;/code&gt; and your preview domain (&lt;code&gt;*.vercel.app&lt;/code&gt;, &lt;code&gt;*.lovable.app&lt;/code&gt;, ...).&lt;/li&gt;
&lt;li&gt;Still nothing? Try a clean browser profile. Ad blockers hide a lot of chat widgets.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Optional: teach your agent once
&lt;/h2&gt;

&lt;p&gt;I got tired of repeating all of this, so I wrote it down as a small, free, vendor-neutral skill for Claude Code and rule for Cursor: &lt;a href="https://github.com/da-head0/add-website-chatbot" rel="noopener noreferrer"&gt;add-website-chatbot on GitHub&lt;/a&gt;. With it installed, "add my tawk.to widget" is enough. It finds the right file, checks for a CSP, and won't invent IDs. It doesn't depend on my product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why there's still a human step, and what I'd like instead
&lt;/h2&gt;

&lt;p&gt;I understand why most services keep a person in the loop. If any script can create accounts, you get spam and abuse, and someone has to own the billing. A magic link is a cheap way to know a real person is there.&lt;/p&gt;

&lt;p&gt;What I'd like as a developer is something in between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The agent requests a key with the email address I gave it.&lt;/li&gt;
&lt;li&gt;The widget works right away on &lt;code&gt;localhost&lt;/code&gt; and preview domains, so the agent can test it end to end.&lt;/li&gt;
&lt;li&gt;I confirm with one click when I'm ready to go live, and nothing is charged until then.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SiteGPT's preview flow is close to that, and it's exactly the flow I'm building OneLineChat around. If you'd use it, you can &lt;a href="https://onelinechat.com/get-api-key?src=devto&amp;amp;utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;join early access here&lt;/a&gt;, or have your agent send the request above with your email. Either way you'll hear from me when keys go out. And if you think the human step should stay, I'd honestly like to hear why in the comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I checked
&lt;/h2&gt;

&lt;p&gt;I read each vendor's own docs and pricing pages in late November 2026. I didn't test paid plans.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SiteGPT: &lt;a href="https://sitegpt.ai/agents" rel="noopener noreferrer"&gt;Agents&lt;/a&gt;, &lt;a href="https://sitegpt.ai/resources/chatbot-cli" rel="noopener noreferrer"&gt;CLI guide&lt;/a&gt; (updated Sep 27, 2026), &lt;a href="https://sitegpt.ai/docs/developers/mcp.md" rel="noopener noreferrer"&gt;MCP docs&lt;/a&gt;, &lt;a href="https://sitegpt.ai/auth.md" rel="noopener noreferrer"&gt;auth.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Chatbase: &lt;a href="https://www.chatbase.co/docs/api-v2/overview" rel="noopener noreferrer"&gt;API v2 overview&lt;/a&gt;, &lt;a href="https://www.chatbase.co/docs/cli/overview.md" rel="noopener noreferrer"&gt;CLI&lt;/a&gt;, &lt;a href="https://www.chatbase.co/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;, &lt;a href="https://chatbase.co/docs/user-guides/chatbot/channels.md" rel="noopener noreferrer"&gt;chat bubble deploy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Chat Data: &lt;a href="https://www.chat-data.com/api-reference/authentication" rel="noopener noreferrer"&gt;API authentication&lt;/a&gt; (updated Nov 12, 2026)&lt;/li&gt;
&lt;li&gt;Widget install guides: &lt;a href="https://help.tawk.to/article/adding-a-widget-to-your-website" rel="noopener noreferrer"&gt;tawk.to&lt;/a&gt;, &lt;a href="https://help.crisp.chat/en/article/how-to-install-crisp-live-chat-software-on-a-custom-website-10wcj3l/" rel="noopener noreferrer"&gt;Crisp&lt;/a&gt;, &lt;a href="https://help.tidio.com/articles/install-website/" rel="noopener noreferrer"&gt;Tidio&lt;/a&gt;, &lt;a href="https://nextjs.org/docs/messages/inline-script-id" rel="noopener noreferrer"&gt;Next.js inline scripts&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These products change fast. If something here is out of date, tell me and I'll fix it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>cursor</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
