skills$openclaw/tg-miniapp
zenith28287.2k

by zenith2828

tg-miniapp – OpenClaw Skill

tg-miniapp is an OpenClaw Skills integration for coding workflows. 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.

7.2k stars310 forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nametg-miniapp
descriptionBuild 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. OpenClaw Skills integration.
ownerzenith2828
repositoryzenith2828/tg-miniapp
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @zenith2828/tg-miniapp
last updatedFeb 7, 2026

Maintainer

zenith2828

zenith2828

Maintains tg-miniapp in the OpenClaw Skills directory.

View GitHub profile
File Explorer
6 files
.
references
components.tsx
7.3 KB
hooks.ts
6.6 KB
KNOWLEDGE.md
10.7 KB
_meta.json
287 B
SKILL.md
2.2 KB
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)

// 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
README.md

No README available.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install tg-miniapp?

Run openclaw add @zenith2828/tg-miniapp in your terminal. This installs tg-miniapp into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/zenith2828/tg-miniapp. Review commits and README documentation before installing.