Menu

HeshBot: a small, self-hosted website chatbot (and three ways to power one)
📰

HeshBot: a small, self-hosted website chatbot (and three ways to power one)

DEV Community: github·Trevor H·20 days ago
#HtloJHpv
#devtogithub#technology#devto#dev#heshbot
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.