Microsoft Teams Adapter
The Teams adapter posts adaptive card messages to a Microsoft Teams channel using an incoming webhook.
import { createMusHandlers } from '@datachef/mus/server'import { teamsAdapter } from '@datachef/mus/adapters/teams'
export const { POST, POSTStandalone, POSTSupportChannel } = createMusHandlers({ adapter: teamsAdapter({ webhookUrl: process.env.TEAMS_WEBHOOK_URL!, }),})TEAMS_WEBHOOK_URL=https://your-org.webhook.office.com/...How to get a webhook URL
Section titled “How to get a webhook URL”- In Teams, open the target channel
- Click … (More options) → Connectors
- Find Incoming Webhook → Configure
- Give it a name and click Create
- Copy the webhook URL
Message formatting
Section titled “Message formatting”teamsAdapter({ webhookUrl: process.env.TEAMS_WEBHOOK_URL!, format: (event) => ({ '@type': 'MessageCard', '@context': 'http://schema.org/extensions', summary: `${event.type} from ${event.user.name}`, themeColor: event.type === 'thumbs-up' ? '41a148' : 'dc2626', sections: [{ activityTitle: `**${event.user.name}** left ${event.type}`, activitySubtitle: event.section.name, facts: [ { name: 'Email', value: event.user.email }, { name: 'Section', value: event.section.name }, { name: 'Project', value: event.projectName }, ], text: event.note, }], }),})