Back to Novu

Slack

docs/agents/channels/slack.mdx

3.19.04.3 KB
Original Source

Use Slack as a messaging channel for your agent. Users can DM or @mention the bot. Novu keeps thread context, shows typing and plan cards during the turn, can attach files on replies, and can post Approve / Deny cards before gated tools run.

Capabilities

CapabilitySupport
Full context historyYes
Threaded repliesYes
Live typing indicator (custom status text)Yes
React with eyes on inbound messagesYes
Plan card (native)Yes
Rich text / Block KitYes
Tap-to-respond buttonsYes
Emoji reactions (both directions)Yes
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 thread

A user @mentions the agent in a thread. Novu adds an eyes reaction, shows typing and a plan card while the agent runs tools, then replies in the same thread with optional action buttons.

Tool approval

When a tool is gated, Slack shows a native approval block (Deny, Approve once, Always allow this tool). The handler resumes after the user selects an option.

Create a Slack app

When the dashboard or CLI asks for a Slack App Configuration Token:

  1. Open Slack API apps.
  2. Under Your App Configuration Tokens, click Generate Token.

  1. Select your workspace and click Generate.
  2. Copy the token (starts with xoxe.xoxp-) and paste it into Novu or the CLI.
  3. Finish the install / Allow flow in Slack.

The configuration token is used once to create the Slack app. Novu does not store it.

Setup

Framework / PlatformGuide
AI SDKConnect AI SDK to Slack
LangChainConnect LangChain to Slack
MastraConnect Mastra to Slack
Claude managed agentConnect Claude managed agent
AWS Claude managed agentConnect AWS Claude managed agent

Connect component

Use SlackConnectButton from @novu/react so end users can install the Slack app and link it to your agent from your product UI.

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

export function SlackConnect() {
  const subscriberId = 'subscriber-id';
  const integrationIdentifier = 'slack-integration-identifier';
  const agentIdentifier = 'agent-identifier';

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

Props and appearance options: 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"> SlackConnectButton props and appearance. </Card> </Columns>