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
| File | Purpose |
|---|---|
backend/src/routes/integrations/channels.ts | API endpoints |
backend/src/infra/integrations/slack/ | Slack OAuth & client |
backend/src/infra/integrations/discord/ | Discord OAuth & client |
backend/src/services/notifications/notifier.service.ts | Sends notifications |
frontend/src/components/settings/IntegrationsSettings.tsx | UI component |
Environment Variables
bash
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_REDIRECT_URI=
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
DISCORD_REDIRECT_URI=Notification Flow
- Event occurs (new comment, approval needed, etc.)
NotificationService.send()called- Looks up company's
CompanyTeamChannelConnection - Matches event type to
notifySettingsrouting - Sends to appropriate platform client