- Home
- Skills
- Frontend & Web Apps
- telegram-mini-app-pro
More screenshots
Works with the AI Agents you already use
Telegram Mini App Pro
Production-ready Telegram Mini App code: viewport and theme fixes, native buttons, server-side initData verification, Stars payments, TON Connect and Docker deploy.
$8
telegram-mini-app-pro
Example session with this skill installed
Build a React scaffold for a Telegram Mini App with a checkout button and secure backend verification.
- Read your context and instructions
- Compiled the telegram-mini-app-pro
- Generated the app files
I have generated a production-grade React scaffold with a companion Node.js backend to handle Telegram's native UI and cryptographic security.
TMA Production Scaffold
Frontend: React + SDK Integration
import { useEffect } from 'react';
const TelegramApp = () => {
useEffect(() => {
const tg = window.Telegram.WebApp;
tg.ready();
tg.expand();
// Setup MainButton for Checkout
tg.MainButton.setText('CHECKOUT ($25.00)');
tg.MainButton.show();
tg.MainButton.onClick(() => {
tg.HapticFeedback.notificationOccurred('success');
console.log('Payment initiated');
});
return () => tg.MainButton.hide();
}, []);
return (
<div style={{
height: 'var(--tg-viewport-height)',
backgroundColor: 'var(--tg-theme-bg-color)',
color: 'var(--tg-theme-text-color)'
}}>
<h1>Premium Service</h1>
<p style={{ color: 'var(--tg-theme-hint-color)' }}>Secure Telegram Checkout</p>
</div>
);
};
Backend: Node.js Auth Middleware
const crypto = require('crypto');
function verifyTelegramAuth(initData, botToken) {
const urlParams = new URLSearchParams(initData);
const hash = urlParams.get('hash');
urlParams.delete('hash');
const dataCheckString = Array.from(urlParams.entries())
.sort(([a], [b]) => a.localeCompare(b))
.map(([key, value]) => `${key}=${value}`)
.join('\n');
const secretKey = crypto.createHmac('sha256', 'WebAppData').update(botToken).digest();
const signature = crypto.createHmac('sha256', secretKey).update(dataCheckString).digest('hex');
const authDate = parseInt(urlParams.get('auth_date'));
const isExpired = (Math.floor(Date.now() / 1000) - authDate) > 86400;
return signature === hash && !isExpired;
}
Next steps
- Set your WebApp URL in @BotFather using the
/setwebappcommand. - Deploy the backend with your
TELEGRAM_BOT_TOKENas an environment variable. - Include
<script src="https://telegram.org/js/telegram-web-app.js"></script>in your index.html.
index.html
ZIP · project files
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Telegram Mini Apps run in a special WebView, and most problems come from details the docs scatter across many pages: the 100vh bug, the app closing when the user scrolls, handlers firing twice, unverified user identity, and payments confirmed only on the client. Telegram Mini App Pro gives your AI coding agent a tested workflow and working reference code for each of these.
WHAT IT DOES
- Builds or fixes Mini Apps in React + Vite, Next.js or plain JS
- Verifies every user on the server before trusting their id
- Adds Telegram Stars payments and TON wallet connect with the server-side checks that protect your money
- Prepares deployment: Docker, nginx, HTTPS and BotFather setup
WHAT IS COVERED
- Viewport and layout: stable height variables instead of 100vh, safe areas for fullscreen mode and notches (Bot API 8.0+), disabling swipe-to-close while scrolling (Bot API 7.7+)
- Theme: Telegram theme variables mapped to Tailwind tokens, live light/dark updates, no flash on load
- Native UI: MainButton and BackButton React hooks with proper cleanup (no duplicate handlers), haptic feedback, confirm and alert popups
- Authentication: initData verification in Node.js and Python (HMAC with the bot token), plus the Ed25519 method for third-party verification, freshness checks and constant-time comparison
- Telegram Stars: server-created invoices, pre-checkout handling, idempotent fulfilment, refunds
- TON Connect: manifest, provider, wallet ownership proof, and on-chain confirmation before delivering goods
- Deployment: multi-stage Dockerfile, SPA nginx config that works inside Telegram Web's iframe, HTTPS notes, BotFather steps
WHAT YOU GET
- SKILL.md with a 5-step workflow (context, client scaffold, server auth, optional features, deploy)
- 6 reference files: viewport-and-theme, native-ui, init-data-verification, stars-payments, ton-connect, docker-and-botfather
- A test checklist in every reference, including a tampered-initData test that must return 401
HOW TO USE Install the skill and ask, for example:
- "My Telegram Mini App is cut off at the bottom and closes when I scroll. Fix it."
- "Add secure login to my FastAPI backend using Telegram initData."
- "Add a 100 Stars purchase to my Mini App." The skill asks up to 3 short questions (frontend, backend language, features), then continues.
HONEST LIMITS Mini Apps must be tested inside Telegram on iOS, Android and Desktop; a normal browser does not reproduce everything. Some features need newer Bot API versions, and the skill adds version checks and fallbacks. Payment and wallet code is a starting point: review it and test with a test bot or testnet before real money. Stars are for digital goods; check Telegram's current terms before launch.
Requires valid SSL for production. Cryptographic verification requires a backend server; client-side-only validation is insecure.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
- Accounts
Telegram
- Software
Python
Node.js
Permissions
Allowed Hosts
What's inside
Frequently Asked Questions
New in Frontend & Web Apps
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.