Telegram Mini App Dev

Build Telegram Mini Apps without the pain. Includes solutions for safe areas, fullscreen mode, BackButton handlers, sharing with inline mode, position:fixed issues, and React gotchas. Use when building or debugging Telegram Mini Apps, or when encountering issues with WebApp API, safe areas, or sharing.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
1 · 2k · 1 current installs · 2 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included files (hooks, components, knowledge base). The referenced APIs (window.Telegram.WebApp, WebApp.shareMessage, bot.savePreparedInlineMessage, R2/CDN, resvg-wasm) are relevant to building Telegram Mini Apps.
Instruction Scope
SKILL.md and code only instruct reading Telegram WebApp state, handling UI issues, preparing inline messages, and server-side image generation patterns. No instructions ask the agent to read unrelated system files, environment variables, or transmit arbitrary data to unknown endpoints.
Install Mechanism
No install spec is provided (instruction-only), so nothing is downloaded or written to disk. References to libraries (e.g., @resvg/resvg-wasm, @telegram-apps/sdk) are typical dependencies for the documented tasks and would be installed by the user if needed.
Credentials
The skill declares no required environment variables or credentials. The documentation correctly separates client-side code from server-side needs (e.g., backend calling bot.savePreparedInlineMessage). No unexpected secret access is requested.
Persistence & Privilege
always is false and the skill is user-invocable; it does not request persistent/system-level privileges or modify other skills' configs. All code is client-side utilities meant to be copy/pasted into projects.
Assessment
This skill appears coherent and safe for its stated purpose: reusable React hooks/components and a knowledge base for Telegram Mini Apps. Before using, ensure you do not copy any server-side bot tokens or other secrets into client code — server-side calls that prepare inline messages must hold bot credentials on the server only. If you implement the suggested server-side image generation (resvg-wasm, R2/CDN), secure those services and credentials appropriately. Review any third-party packages (@telegram-apps/sdk, resvg) you add to your project for supply-chain risk, and verify behavior on actual iOS/Android Telegram clients as recommended in the testing checklist.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.1
Download zip
botvk974np8et61j22epsqpndc6tq980c5xwcloudflare-workersvk974np8et61j22epsqpndc6tq980c5xwcomponentsvk9744dpd23xqs085y0e81keeh580cg2zfullscreenvk974np8et61j22epsqpndc6tq980c5xwhooksvk9744dpd23xqs085y0e81keeh580cg2zinline-modevk974np8et61j22epsqpndc6tq980c5xwlatestvk974np8et61j22epsqpndc6tq980c5xwmini-appvk974np8et61j22epsqpndc6tq980c5xwreactvk974np8et61j22epsqpndc6tq980c5xwresvgvk974np8et61j22epsqpndc6tq980c5xwsafe-areavk974np8et61j22epsqpndc6tq980c5xwshare-cardsvk974np8et61j22epsqpndc6tq980c5xwsharingvk974np8et61j22epsqpndc6tq980c5xwtelegramvk974np8et61j22epsqpndc6tq980c5xwtmavk974np8et61j22epsqpndc6tq980c5xwtypescriptvk9744dpd23xqs085y0e81keeh580cg2zwebappsvk974np8et61j22epsqpndc6tq980c5xw

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Telegram Mini App Development

Battle-tested solutions for common Telegram Mini App issues.

Quick Reference

Safe Area (Fullscreen Mode)

// Use reactive hook - values are async and context-dependent
const safeArea = useSafeAreaInset(); // from references/hooks.ts
<div style={{ paddingTop: safeArea.top }}>Header</div>

position:fixed Broken

Telegram applies transform to container. Use createPortal:

import { createPortal } from 'react-dom';
createPortal(<Modal />, document.body);

BackButton Not Firing

Use @telegram-apps/sdk, not raw WebApp:

import { onBackButtonClick, showBackButton } from '@telegram-apps/sdk';
onBackButtonClick(handleBack);

Sharing with Inline Mode

  1. Enable inline mode: @BotFather → /setinline → select bot
  2. Backend calls savePreparedInlineMessage → returns prepared_message_id
  3. Frontend calls WebApp.shareMessage(prepared_message_id)

Note: prepared_message_id is single-use — prepare fresh for each share tap. For static content, consider caching images on R2/CDN and preparing per-tap.

React "0" Rendering

// WRONG: renders literal "0"
{count && <span>{count}</span>}

// CORRECT
{count > 0 && <span>{count}</span>}

Detailed Guides

Testing Checklist

Before shipping, test:

  • Open from folder (chat list)
  • Open from direct bot chat
  • iOS device
  • Android device
  • Share flow (tap → dismiss → tap again)
  • Share to different chat types (user, group, channel)
  • Back button
  • Scroll with sticky header

Files

4 total
Select a file
Select a file to preview.

Comments

Loading comments…