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.
Server handlers
Section titled “Server handlers”Old way (still fully supported)
Section titled “Old way (still fully supported)”Export the handlers directly. They read SLACK_BOT_TOKEN from process.env and call Slack directly:
export { POST } from '@datachef/mus/server'
// app/api/mus/standalone-upload/route.tsexport { POSTStandalone as POST } from '@datachef/mus/server'
// app/api/mus/support-channel/route.tsexport { POSTSupportChannel as POST } from '@datachef/mus/server'New way: adapter pattern
Section titled “New way: adapter pattern”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.
Upgrading to v0.4.0
Section titled “Upgrading to v0.4.0”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.
ffmpeg-static is now optional
Section titled “ffmpeg-static is now optional”v0.4.0 moves ffmpeg-static to optionalDependencies. If voice upload stops working, install it manually:
npm install ffmpeg-staticUser resolvers
Section titled “User resolvers”Explicit resolver
Section titled “Explicit resolver”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.
Environment variable
Section titled “Environment variable”All server handlers (both old and new) use SLACK_BOT_TOKEN from your environment:
SLACK_BOT_TOKEN=xoxb-your-bot-token