Skip to content

Team Integrations

Overview

Allows companies to receive TendSocial notifications in Slack, Discord, or Microsoft Teams.

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   Frontend UI   │───▶│   Backend API   │───▶│ Platform Clients│
│IntegrationsSettings│  │  channels.ts    │    │ Slack/Discord/  │
└─────────────────┘    └─────────────────┘    │     Teams       │
                              │               └─────────────────┘

                       ┌─────────────────┐
                       │    Database     │
                       │CompanyTeamChannel│
                       │   Connection    │
                       └─────────────────┘

Database Model

prisma
model CompanyTeamChannelConnection {
  id            String   @id @default(uuid())
  companyId     String
  channelType   String   // "slack", "discord", "teams"
  accessToken   String   @db.Text  // encrypted
  refreshToken  String?  @db.Text  // encrypted
  botToken      String?  @db.Text  // encrypted
  workspaceId   String
  workspaceName String
  channels      Json     // configured channels
  notifySettings Json?   // notification routing
  isActive      Boolean  @default(true)
}

Key Files

FilePurpose
backend/src/routes/integrations/channels.tsAPI endpoints
backend/src/infra/integrations/slack/Slack OAuth & client
backend/src/infra/integrations/discord/Discord OAuth & client
backend/src/services/notifications/notifier.service.tsSends notifications
frontend/src/components/settings/IntegrationsSettings.tsxUI component

Environment Variables

bash
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_REDIRECT_URI=

DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
DISCORD_REDIRECT_URI=

Notification Flow

  1. Event occurs (new comment, approval needed, etc.)
  2. NotificationService.send() called
  3. Looks up company's CompanyTeamChannelConnection
  4. Matches event type to notifySettings routing
  5. Sends to appropriate platform client

TendSocial Documentation