Bun
Free Bun Twitch bot hosting.
Twurple, tmi.js, or a WebSocket and nothing else: Bun ships one built in. Your .ts file runs as it is, with no compile step.
Libraries
Libraries that run here
Twurple
The natural fit. It is written in TypeScript and covers chat, the Helix API and EventSub, and your .ts entry file runs directly under Bun.
tmi.js
Runs from the same package.json it would use under Node. Chat only; the better choice if you are following an older tutorial for a command bot.
Plain WebSocket
Twitch chat is IRC over a WebSocket, and Bun has WebSocket built in. A listen-and-reply bot is a short file with no dependencies at all.
Deploying
Getting it running
- 1
Upload your project
Drag the folder in or push it over SFTP, without node_modules. It is installed on deploy.
- 2
bun install runs for you
Your package.json is read and installed before the bot starts. The same file works under Node, so choosing Bun is not a commitment.
- 3
Point us at your entry file
bot.ts or index.ts, uncompiled. Client ID and secret go into environment variables; renewed tokens go into a file or a SQLite row your bot writes itself.
Memory
What actually fits in 256 MB
More than a chat bot needs. Chat is small text, Twitch libraries do not cache your viewers, and a bot in several channels sits in tens of megabytes on Bun as it would on Node.
When one does grow, it is state the bot keeps for itself: cooldown maps, message history, every chatter's points held in an object. Bun has a SQLite driver built in, so the permanent parts can live on your 512 MB of disk at the cost of no extra dependency.
FAQ
Questions
Does Twurple work on Bun?
It runs the same code it runs on Node. If a particular release misbehaves, the same package.json runs unchanged on the Node.js runtime, so you are never stuck.
Where should tokens and points live?
In bun:sqlite. One table for the current token pair, updated on every refresh, and one for points or quotes. It needs nothing in package.json and survives restarts, crashes and redeploys.
Do I need to compile TypeScript first?
No. Point us at the .ts file and it runs. Bun strips the types without checking them, so run tsc locally if you want errors caught before chat does.
Does Bun read a .env file?
Automatically, which is convenient and worth being careful with: a .env uploaded with your code sits in your file manager like any other file. Environment variables set on the server keep your client secret out of your files entirely.
More on Twitch bots
Hosting something else?
Control it from code