Adapters
MUS doesn’t care where feedback goes. An adapter is the thing that decides. You configure it once — either as an env var for the Docker image, or as code in your own server — and every event flows through it automatically.
Choosing an adapter
Section titled “Choosing an adapter”| Adapter | Env var (Docker) | Code import |
|---|---|---|
| Slack | SLACK_BOT_TOKEN | slackAdapter |
| Discord | DISCORD_WEBHOOK_URL | discordAdapter |
| Microsoft Teams | TEAMS_WEBHOOK_URL | teamsAdapter |
| Webhook | WEBHOOK_URL | webhookAdapter |
| Custom | — | implement MusAdapter |
Docker image
Section titled “Docker image”If you’re using the mus-server Docker image, just set the env var. No code needed.
docker run -d -p 3001:3001 \ -e SLACK_BOT_TOKEN=xoxb-your-token \ ghcr.io/datachefhq/mus-server:latestSet multiple env vars to fan out to several destinations at once:
docker run -d -p 3001:3001 \ -e SLACK_BOT_TOKEN=xoxb-your-token \ -e DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... \ ghcr.io/datachefhq/mus-server:latestFramework handlers (Next.js, Express, Fastify, Hono)
Section titled “Framework handlers (Next.js, Express, Fastify, Hono)”Import createMusHandlers and pass whichever adapters you want:
import { createMusHandlers } from '@datachefhq/mus/server'import { slackAdapter } from '@datachefhq/mus/adapters/slack'
export const { POST, POSTStandalone, POSTSupportChannel } = createMusHandlers({ adapter: slackAdapter({ token: process.env.SLACK_BOT_TOKEN! }),})Pass an array to run multiple adapters in parallel. A failure in one won’t block the others:
import { slackAdapter } from '@datachefhq/mus/adapters/slack'import { discordAdapter } from '@datachefhq/mus/adapters/discord'
createMusHandlers({ adapter: [ slackAdapter({ token: process.env.SLACK_BOT_TOKEN! }), discordAdapter({ webhookUrl: process.env.DISCORD_WEBHOOK_URL! }), ],})The MusAdapter interface
Section titled “The MusAdapter interface”Every adapter implements this interface. Only the methods you define are called — unimplemented ones are silently skipped.
interface MusAdapter { onVoiceUpload?(event: VoiceEvent): Promise<void> onSupportRequest?(event: SupportEvent): Promise<{ channelId?: string }> onStandaloneFeedback?(event: StandaloneEvent): Promise<void>}See Event Types for the full shape of each event.