---
title: "Telegram Handler"
description: "Sending logs to Telegram"
canonical_url: "https://bitrix24.github.io/b24jssdk/docs/working-with-the-rest-api/logger-telegram"
last_updated: "2026-05-08"
---
# Telegram Handler

> Sending logs to Telegram

> [!WARNING]
> We are still updating this page. Some data may be missing here — we will complete it shortly.

## Quick Start

### Installing and setting up a Telegram bot

```bash
# Create a bot via @BotFather
# Get the token and chat_id
```

### Usage on the server side

```ts
import { LogLevel, Logger, TelegramHandler } from '@bitrix24/b24jssdk'

// Create a logger with Telegram handler
const $logger = new Logger('my-app')

const telegramHandler = new TelegramHandler(LogLevel.ERROR, {
  botToken: 'YOUR_BOT_TOKEN',
  chatId: 'YOUR_CHAT_ID',
  parseMode: 'HTML', // or 'MarkdownV2'
  disableNotification: false, // Send notifications
  disableWebPagePreview: true // Disable link previews
});

$logger.pushHandler(telegramHandler)

// Now critical errors will be sent to Telegram
$logger.error('Payment service unavailable', {
  service: 'stripe',
  error: 'Connection timeout',
  duration: '30s'
})
```

### Usage on the client side

> [!CAUTION]
> On the client side, it is not supported due to security requirements.

## Sitemap

See the full [sitemap](/b24jssdk/sitemap.md) for all pages.
