Home/Skills/Web & Frontend/Telegram Mini App Dev
Zenith2828

Telegram Mini App Dev

2 versions
Zenith2828·Feb 2, 2026

Summary

TL;DR: Guides your AI agent through building Telegram Mini Apps, covering the WebApp SDK, user authentication, bot integration, payments, and platform-specific UI.

Telegram Mini App Dev is an OpenClaw skill that 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.

Created by Zenith2828, this skill has been downloaded 2k+ times on ClawHub. Install it with one command and your AI agent gains these capabilities right away.

Use cases

  • Set up a Telegram Mini App project with proper SDK initialization and auth validation
  • Implement Telegram Stars payments for in-app purchases
  • Build a Mini App that reads and writes to Telegram cloud storage
  • Create a bot command that opens your Mini App with pre-filled context

Installation

Run this command to install the skill on your OpenClaw agent:

Install with OpenClaw
npx clawhub@latest install tg-miniapp
Downloads
2k
Active installs
1
Stars
1
Updated
Feb 2, 2026

Security scan

Security scan
VirusTotalBenign
View report
OpenClawBenignhigh confidence

This is an instruction-only skill with copy-paste React hooks/components and documentation that align with its stated purpose of helping build Telegram Mini Apps; it asks for no credentials or installs and contains no obvious exfiltration or unrelated capabilities.

Purpose & Capability
Instruction Scope
Install Mechanism
Credentials
Persistence & Privilege

SKILL.md

SKILL.md
---
name: tg-miniapp
description: 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.
---

# 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](references/KNOWLEDGE.md)** — Full knowledge base with all gotchas and solutions
- **[references/hooks.ts](references/hooks.ts)** — Copy-paste React hooks (useSafeAreaInset, useFullscreen, etc.)
- **[references/components.tsx](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

Version history

v1.0.1Latest
Feb 2, 2026

- Improved sharing instructions for inline mode, clarifying the `prepared_message_id` flow. - Added a note that `prepared_message_id` is single-use; advise preparing a fresh ID for each share. - Suggested caching images on R2/CDN for static content to optimize sharing. - Expanded the testing checklist: now includes checks for repeat share flow and sharing to different chat types.

v1.0.0
Feb 2, 2026

- Initial release of tg-miniapp. - Provides solutions for safe area insets, fullscreen mode, BackButton handling, WebApp API issues, and position:fixed bugs. - Offers React hooks and components for easier integration with Telegram Mini Apps. - Includes detailed guides, copy-paste code samples, and a pre-launch testing checklist.

Frequently asked questions

You can use any web framework. React, Vue, Svelte, and plain HTML all work. The Telegram WebApp SDK is framework-agnostic. The skill covers integration patterns for the most popular choices.

Installation method

Send this prompt to your agent to install the skill

npx clawhub@latest install tg-miniapp
Download ZIP

Skill info

Versionv1.0.1
AuthorZenith2828
UpdatedFeb 2, 2026

Files

SKILL.md2.2 KB

Run OpenClaw in the cloud

Deploy in seconds. Skills pre-installed.

See plans

Skill data sourced from ClawHub