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
- Validate initData HMAC with the bot token on every session start.
- Expire initData (auth_date) aggressively.
- Do not put bot tokens in the Mini App frontend.
- Use HTTPS only; follow Telegram's CSP/domain rules.
- 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'.