Quickstart
Build a channel monitor bot in 5 minutes
Build a bot that watches a channel and responds to messages. You’ll use all three SDK modes: queries to read, mutations to write, and realtime to subscribe.
Prerequisites
- A start.chat server you admin
- An API key from Server Settings → API Keys
- Node.js 18+
1. Set up
Terminal
Create bot.ts:
2. Find your channel
Run it to get IDs:
Terminal
3. Read messages
4. Send a message
5. Subscribe to live updates
This is where it gets interesting. Instead of polling, subscribe to the channel and react to new messages in real-time:
Run it:
Terminal
Your bot is now watching the channel. Send “hello” in the channel and it responds instantly — no polling, no webhooks, no WebSocket boilerplate.
6. Error handling