Documentation

Full docs are in the repo — this page is a quick start.

1. Create a bot

Sign in, click Add bot, name it, and copy your pk_live_* API key.

2. Install the SDK

npm install tgvizor
# or
gem install tgvizor

3. Wire the middleware

grammY
import { Bot } from 'grammy';
import { TgVizor } from 'tgvizor';
import { tgvizorMiddleware } from 'tgvizor/grammy';

const vizor = new TgVizor({ apiKey: process.env.TGVIZOR_API_KEY! });
const bot = new Bot(process.env.BOT_TOKEN!);

bot.use(tgvizorMiddleware(vizor));

bot.command('start', (ctx) => ctx.reply('Hello!'));
bot.start();
Telegraf
import { Telegraf } from 'telegraf';
import { TgVizor } from 'tgvizor';
import { tgvizorMiddleware } from 'tgvizor/telegraf';

const vizor = new TgVizor({ apiKey: process.env.TGVIZOR_API_KEY! });
const bot = new Telegraf(process.env.BOT_TOKEN!);

bot.use(tgvizorMiddleware(vizor));
Ruby (telegram-bot-ruby)
require 'telegram/bot'
require 'tgvizor'
require 'tgvizor/middleware/telegram_bot_ruby'

vizor   = TgVizor::Client.new(api_key: ENV['TGVIZOR_API_KEY'])
tracker = TgVizor::Middleware::TelegramBotRuby.new(vizor)

Telegram::Bot::Client.run(TOKEN) do |bot|
  bot.listen do |update|
    tracker.track(update) do
      # your handler
    end
  end
end

4. Send your first event

Start your bot and send it a message. Open the dashboard and watch the Live stream page.

No SDK? Use HTTP directly

curl -X POST https://ingest.tgvizor.com/v1/events \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pk_live_xxx" \
  -d '{
    "events": [
      { "event": "command", "userId": 12345, "properties": { "command": "/start" } }
    ]
  }'

Rate limits

500 requests/second per API key. Free plan 50k events/month, Pro 500k, Business 5M. Exceeding either returns HTTP 429 — the SDK automatically backs off and retries.