BotNetwork

Telegram Mini Apps notes for bot developers

Init data validation and opening from a bot button.

Guide1 min readUpdated

Why it matters

Telegram Mini Apps (Web Apps) run inside Telegram with initData you must validate — treat them as a browser client, not a trusted backend.

Practical steps

  1. Validate initData HMAC with the bot token on every session start.
  2. Expire initData (auth_date) aggressively.
  3. Do not put bot tokens in the Mini App frontend.
  4. Use HTTPS only; follow Telegram's CSP/domain rules.
  5. Keep sensitive mutations on your backend after validation.

Watch out for

  • Trusting user ids from the query string without HMAC.
  • Shipping a Mini App that embeds the bot token for 'convenience'.

Related comparisons and tools