Adding an AI chatbot to a static site without exposing your API key
A developer shares a cautionary account of adding an AI chatbot to a small business's static HTML website by calling the AI API directly from the browser. They discovered the API key was visible to anyone in the browser's DevTools, exposing it to theft and unauthorized credit use. The article explains further risks, including spam abuse, generic answers lacking business context, and lost leads. It recommends moving the key to a server-side backend, which still requires extra work such as rate limiting, CORS controls, cost caps, and content training. The author also promotes their own widget service, RSFlowHub, which avoids a custom backend through domain-restricted tokens and a dashboard.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in