Skip to content

Telegram Mini App Dev

Verified

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.

979

Install

Claude Code

Add to .claude/skills/

About This Skill

# Telegram Mini App Development

Battle-tested solutions for common Telegram Mini App issues.

Quick Reference

Safe Area (Fullscreen Mode) ```typescript // 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`: ```tsx import { createPortal } from 'react-dom'; createPortal(<Modal />, document.body); ```

BackButton Not Firing Use `@telegram-apps/sdk`, not raw WebApp: ```typescript 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 ```tsx // WRONG: renders literal "0" {count && <span>{count}</span>}

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

Detailed Guides

  • references/KNOWLEDGE.md — Full knowledge base with all gotchas and solutions
  • references/hooks.ts — Copy-paste React hooks (useSafeAreaInset, useFullscreen, etc.)
  • references/components.tsx — Ready-to-use components (SafeAreaHeader, DebugOverlay)

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

Use Cases

  • Build Telegram Mini Apps with proper safe area and fullscreen handling
  • Implement BackButton navigation handlers for in-app routing
  • Set up sharing with inline mode for Telegram Mini App content distribution
  • Handle position:fixed quirks and viewport issues specific to Telegram WebView
  • Debug common Telegram Mini App rendering and interaction issues

Pros & Cons

Pros

  • + Addresses real pain points specific to Telegram Mini App development
  • + Covers non-obvious issues like safe areas, BackButton, and position:fixed quirks
  • + Practical solutions rather than theoretical documentation

Cons

  • - Niche audience — only relevant for Telegram Mini App developers
  • - May become outdated as Telegram updates its Mini App platform

Frequently Asked Questions

What does Telegram Mini App Dev do?

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.

What platforms support Telegram Mini App Dev?

Telegram Mini App Dev is available on Claude Code, OpenClaw.

What are the use cases for Telegram Mini App Dev?

Build Telegram Mini Apps with proper safe area and fullscreen handling. Implement BackButton navigation handlers for in-app routing. Set up sharing with inline mode for Telegram Mini App content distribution.

Stay Updated on Agent Skills

Get weekly curated skills + safety alerts