Back to Novu

Microsoft Teams

docs/agents/channels/microsoft-teams.mdx

3.19.03.7 KB
Original Source

Use Microsoft Teams as a messaging channel for your agent. Novu keeps conversation context, shows typing during the turn, can update a plan card in place, can attach files on replies, and posts Adaptive Card approvals for gated tools.

Capabilities

CapabilitySupport
Full context historyYes
Threaded repliesYes
Live typing indicator (custom status text)Yes
React with eyes on inbound messagesYes
Plan card (markdown edit-in-place / Adaptive Card)Yes
Rich text / markdownYes
Tap-to-respond buttonsYes
Emoji reactionsYes
Message edits in placeYes
Action / MCP tool approvalYes
MCP connect cardYes
Resolve conversationYes
File sharingYes
Streaming word-by-wordNot yet

Full matrix: Channels overview.

Examples

Inbound chat

A user messages the agent in Teams. Novu adds an eyes reaction, shows typing, updates a plan card while tools run, then replies with action buttons.

Tool approval

Gated tools surface as an Adaptive Card (Deny, Approve once, Always allow this tool). The turn resumes after the user selects an option.

Setup

Framework / PlatformGuide
Custom code agentFollow a connect guide, then add Teams as another provider on the same agent
Managed agentClaude or AWS Claude, then link Teams in the dashboard

Teams provider credentials and app packaging are configured in the Novu dashboard when you add the Microsoft Teams provider.

Connect component

Use MsTeamsConnectButton from @novu/react so end users can admin-consent and link Teams to your agent from your product UI. In subscriber mode, autoLinkUser defaults to true so the per-user Teams identity is linked after consent.

tsx
import { NovuProvider, MsTeamsConnectButton } from '@novu/react';

export function TeamsConnect() {
  const subscriberId = 'subscriber-id';
  const integrationIdentifier = 'msteams-integration-identifier';

  return (
    <NovuProvider
      applicationIdentifier={process.env.NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER!}
      subscriberId={subscriberId}
    >
      <MsTeamsConnectButton
        integrationIdentifier={integrationIdentifier}
        connectionMode="subscriber"
        connectLabel="Install agent ↗"
        connectedLabel="Connected to MS Teams"
        onConnectSuccess={() => {
          // Workspace linked
        }}
        onConnectError={(error: unknown) => {
          console.error(error);
        }}
      />
    </NovuProvider>
  );
}

If auto-link fails after consent, use MsTeamsLinkUser as a follow-up step. Full prop reference: Connect components.

<Columns cols={2}> <Card href="/agents/custom-code-agent/building-blocks/reply" title="Reply" icon="message-square"> Plain text, markdown, and interactive cards. </Card> <Card href="/agents/custom-code-agent/building-blocks/typing-indicator" title="Typing indicator" icon="ellipsis"> Custom status text while the handler runs. </Card> <Card href="/agents/custom-code-agent/building-blocks/tool-approval" title="Tool approval" icon="shield-check"> Approve / Deny before tools execute. </Card> <Card href="/agents/custom-code-agent/building-blocks/edit-sent-messages" title="Edit sent messages" icon="pencil"> Update a sent message in place. </Card> <Card href="/agents/custom-code-agent/connect-components" title="Connect components" icon="plug"> MsTeamsConnectButton and MsTeamsLinkUser. </Card> </Columns>