Build your own FounderLoop
How we wired FounderLoop to Switch, in the order we set it up. If you’re new to Switch, start with the quickstart: it gets one agent answering in a chat channel in about ten minutes.
Run a Switch server
Install Switch Console or run Switch’s published Docker Compose deployment. FounderLoop uses the standalone Docker server with its Gateway, because the Console-managed local server didn’t expose a registration key for an external agent.
Connect Discord and Slack
Attach both bridges to the same server. Map the channel where your users talk and the private founder, product, sales and support channels to rooms, and invite the agent.
Fill in Switch room IDs
Use Switch room IDs, not Slack or Discord channel IDs. Take your own Switch sender ID from a real message you send in the founder room.
SWITCH_SOURCE_ROOM_IDS=... SWITCH_FOUNDER_ROOM_ID=... SWITCH_PRODUCT_ROOM_ID=... FOUNDER_SWITCH_SENDER_ID=...Open the agent connection
Bearer-authenticated WebSocket with
scope=allandfilter=all. Store the cursor so a restart resumes, and answer ping with pong.Run FounderLoop
The demo needs no Switch server or credentials.
npm run livestarts the real agent once rooms are configured.npm ci npm test # 30 tests npm run demo:product # Product-only walkthrough npm run demo # all three categories npm run live # real agent (needs .env)
What tripped us up
- Don’t run one bot token on two servers. If Slack or Discord is attached to another Switch server, stop it first or use separate test apps.
- Room IDs aren’t channel IDs. Switch room IDs, Slack channel IDs and Slack user IDs are all different values.
- Generic events may not carry native IDs. If you need a link to the exact source message, check what your events actually contain first.
- Control frames nest their fields. Connection state and ping arrive as
{event, data}. - Don’t blindly retry posts. A timeout could mean the post landed. FounderLoop marks it uncertain instead of sending twice.
FounderLoop is open source: GitHub. Built on Switch for the Flip the Switch hackathon.