๐ฌ Telegram Bot
Two ways to use Telegram in Synalux: as a chat provider for your team and patients, or as a sign-in method via Telegram Login Widget.
๐จ Telegram Bot API Integration
Send and receive Telegram messages from inside Synaluxโs unified chat surface. No separate Telegram app for staff to monitor.
- Webhook-driven โ incoming messages POST to
/api/v1/telegram/webhookand surface in the Synalux chat surface in real time. - Send โ outbound replies via
/api/v1/telegram/send. Workspace-scoped bot token; one bot per workspace. - Bot setup โ provide your bot token from
@BotFatherin the workspace settings; webhook URL auto-registers viasetWebhook. - Media support โ text, images, documents, voice notes (transcribed via the Transcription module on receipt).

๐ Telegram Login Widget
End-to-end implementation of the Telegram Login Widget for sign-in.
- Users click a Telegram-blue button on
/auth; Telegram OAuth flow returns user identity (telegram_id, name, photo). - Identity is bound to a Synalux user record; subsequent sign-ins are one-tap.
bot_tokenHMAC validation per the Telegram Login Widget specย โ replay-attack proof.
๐๏ธ Architecture
POST /api/v1/telegram/webhook Webhook ingress (validated against bot token + IP allowlist)
POST /api/v1/telegram/send Outbound message (workspace-scoped)
GET /api/v1/telegram/auth/callback Login Widget callback (HMAC-validated)Provider abstraction: lib/message-providers/telegram.ts โ same shape as Gmail / Outlook / Slack so the unified chat surface lights up automatically.
๐งช Tests
24+ tests cover bot routes + lib (auth callback HMAC validation, webhook ingestion, send queue, error paths, retry logic). See portal/src/app/api/v1/telegram/__tests__/.
๐ณ Plans
Available on Standard+ as part of the unified chat experience. Free tier: receive only via the public landing page contact form.