Skip to content
Set up your Agent

Connect Components

Use prebuilt React components so your users can install and connect Slack, Microsoft Teams, Telegram and other communication platforms to your agent.

Novu provides pre-built UI components for chat platforms like Slack, Microsoft Teams, Telegram and other communication platforms. Add these components so users can install the communication platform app in their workspace and connect it to your agent.

Slack connect button

SlackConnectButton is a pre-built UI component in the @novu/react SDK that connects an agent to a Slack workspace. Check out the example below.

import { SlackConnectButton } from '@novu/react';
 
const SlackConnectButtonComponent = () => {
  const subscriberId = 'subscriber-id';
  const integrationIdentifier = 'integration-identifier';
  const agent = {
    identifier: 'agent-identifier',
    name: 'agent-name',
  };
 
  const handleSlackOAuthSuccess = () => {
    // Handle success
  };
 
  return (
    <SlackConnectButton
      integrationIdentifier={integrationIdentifier}
      connectionIdentifier={`${subscriberId}:${integrationIdentifier}:${agent.identifier}`}
      connectionMode="subscriber"
      connectLabel={`Install ${agent.name} ↗`}
      connectedLabel="Connected to Slack"
      onConnectSuccess={handleSlackOAuthSuccess}
      onConnectError={(error: unknown) => {
        console.error(error);
      }}
    />
  );
};
 
export default SlackConnectButtonComponent;

API reference

SlackConnectButton accepts the following props to customize the UI and behavior:

PropTypeDefault
container?
string | Node | null
-
appearance?
ReactInboxAppearance | ReactSubscriptionAppearance | ReactAllAppearance
-
connectedLabel?
string
-
connectLabel?
string
-
onDisconnectError?
((error: unknown) => void)
-
onDisconnectSuccess?
(() => void)
-
onConnectError?
((error: unknown) => void)
-
onConnectSuccess?
((connectionIdentifier: string) => void)
-
connectionMode?
ConnectionMode
-
scope?
string[]
-
context?
Partial<Record<string, ContextValue>>
-
subscriberId?
string
-
connectionIdentifier?
string
-
integrationIdentifier?
string
-

Microsoft Teams connect button

Novu is working on adding a Microsoft Teams connect button to the @novu/react SDK. Reach out to support at support@novu.co to get access to a pre-release version.

Telegram connect button

Novu is working on adding a Telegram connect button to the @novu/react SDK. Reach out to support at support@novu.co to get access to a pre-release version.

On this page

Edit this page on GitHub