Jump to related tools in the same category or review the original source on GitHub.

Web & Frontend Development @zenith2828 Updated 6/28/2026 2,875 downloads 2 stars Security: Pass

Tg Miniapp OpenClaw Plugin & Skill | ClawHub

Looking to integrate Tg Miniapp into your AI workflows? This free OpenClaw plugin from ClawHub helps you automate web & frontend development tasks instantly, without having to write custom tools from scratch.

What this skill does

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.

Install

ClawHub CLI
openclaw skills install @zenith2828/tg-miniapp
Node.js (npx)
npx clawhub@latest install tg-miniapp

Full SKILL.md

Open original
Metadata table.
namedescription
tg-miniappBuild 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.

SKILL.md content below is scrollable.

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
ClawHub Registry URL: https://clawhub.ai/zenith2828/skills/tg-miniapp

Related skills

If this matches your use case, these are close alternatives in the same category.