Skip to content
Documentation
Documentation

Upgrade Guide

All existing POST, POSTStandalone, and POSTSupportChannel exports continue to work unchanged. Nothing is removed or deprecated, so you can adopt new features incrementally.

Export the handlers directly. They read SLACK_BOT_TOKEN from process.env and call Slack directly:

app/api/mus/voice-upload/route.ts
export { POST } from '@datachef/mus/server'
// app/api/mus/standalone-upload/route.ts
export { POSTStandalone as POST } from '@datachef/mus/server'
// app/api/mus/support-channel/route.ts
export { POSTSupportChannel as POST } from '@datachef/mus/server'

Use createMusHandlers when you want to route feedback to a non-Slack destination, fan out to multiple destinations, or inject custom logic:

// app/api/mus/[...mus]/route.ts (or individual route files)
import { createMusHandlers } from '@datachef/mus/server'
import { slackAdapter } from '@datachef/mus/adapters/slack'
export const { POST, POSTStandalone, POSTSupportChannel } = createMusHandlers({
adapter: slackAdapter({ token: process.env.SLACK_BOT_TOKEN! }),
})

Multiple adapters run in parallel:

import { createMusHandlers } from '@datachef/mus/server'
import { slackAdapter } from '@datachef/mus/adapters/slack'
import { discordAdapter } from '@datachef/mus/adapters/discord'
export const { POST, POSTStandalone, POSTSupportChannel } = createMusHandlers({
adapter: [
slackAdapter({ token: process.env.SLACK_BOT_TOKEN! }),
discordAdapter({ webhookUrl: process.env.DISCORD_WEBHOOK_URL! }),
],
})

See Adapters for all built-in adapters and how to write a custom one.


Stytch auto-detection removed: action required for Stytch users

Section titled “Stytch auto-detection removed: action required for Stytch users”

Prior to v0.4.0, MUS automatically detected a Stytch session if @stytch/react was installed. This has been removed. If your app uses Stytch, add userResolver explicitly:

import { stytchResolver } from '@datachef/mus/resolvers/stytch'
<MusProvider config={{
projectName: 'My App',
slack: { ... },
userResolver: stytchResolver(), // add this
}}>

If you were relying on auto-detection and don’t add this, users will appear as “Anonymous”. Nothing else breaks.

v0.4.0 moves ffmpeg-static to optionalDependencies. If voice upload stops working, install it manually:

Terminal window
npm install ffmpeg-static

Import the resolver for your auth system and pass it to MusProvider. This works for Stytch, Clerk, Auth0, NextAuth, or any custom source:

import { stytchResolver } from '@datachef/mus/resolvers/stytch'
<MusProvider config={{
projectName: 'My App',
slack: { ... },
userResolver: stytchResolver(),
}}>

Available built-in resolvers:

import { stytchResolver } from '@datachef/mus/resolvers/stytch'
import { clerkResolver } from '@datachef/mus/resolvers/clerk'
import { auth0Resolver } from '@datachef/mus/resolvers/auth0'
import { nextAuthResolver } from '@datachef/mus/resolvers/next-auth'

You can also write your own. See Custom Resolvers.


All server handlers (both old and new) use SLACK_BOT_TOKEN from your environment:

.env.local
SLACK_BOT_TOKEN=xoxb-your-bot-token