Server Setup Overview
Why a server is needed
Section titled “Why a server is needed”The browser can’t call the Slack API directly because it would expose your bot token. MUS routes all Slack communication through a server-side handler that reads SLACK_BOT_TOKEN from the environment.
There are two ways to provide this handler:
| Path | Best for |
|---|---|
mus-server Docker image | Vite SPAs, any app without a backend |
@datachef/mus/server handlers | Next.js, Express, Fastify, Hono, Remix |
What the server handles
Section titled “What the server handles”- Voice upload: receives WebM audio from the browser, converts to MP3 with ffmpeg, uploads to Slack
- Standalone upload: receives screenshot PNG + optional voice, posts both to Slack
- Support channel: creates (or finds existing) private Slack channel, invites user + support team
All three endpoints are under /api/mus/:
| Endpoint | Handler |
|---|---|
POST /api/mus/voice-upload | POST |
POST /api/mus/standalone-upload | POSTStandalone |
POST /api/mus/support-channel | POSTSupportChannel |
Pick your path
Section titled “Pick your path”- Next.js App Router: three route files, done
- Express / Fastify / Hono: wrap the handlers in your framework adapter
- Vite SPA + Docker: run
mus-serveralongside your app, proxy/api/mus/in Vite config
Environment variable
Section titled “Environment variable”All paths require one environment variable:
SLACK_BOT_TOKEN=xoxb-your-tokenThe token needs these Slack bot scopes:
chat:write: post messagesfiles:write: upload voice recordingschannels:manageorgroups:write: create support channelsusers:read.email: look up users by email for channel invites