The chat bubble on trevorheshka.com is HeshBot, a chatbot I wrote to replace the Typebot widget I had before. I wanted something small that I fully own: no build step, no framework, no third-party chat platform. The code is open source under the MIT license at github.com/YardPhantom/HeshBot .
This post covers how it's put together, the different ways you could power a bot like this, and what a small business could actually use one for.
What's in the repo
HeshBot has three parts.
The widget. heshbot.js and heshbot.css are plain JavaScript and CSS with no dependencies. A tiny launcher bubble loads the full widget only when someone clicks it, so it costs almost nothing on page load. It works from the keyboard (Enter sends, Shift+Enter adds a new line, Esc closes), uses ARIA dialog and log roles, and goes full-screen on phones. Bot replies go through a small markdown renderer that escapes everything first and then adds back a short whitelist of tags.…