Telegram Mini Apps: a complete overview of the platform
How Telegram Mini Apps work: the bot, the page, signed user data and payments in Stars; 8 areas, pros and cons, a comparison with a bot, a site and a mobile app, security rules and code examples.
In short
A Telegram Mini App is an ordinary web page that opens inside Telegram as a full interface: catalogues, bookings, personal accounts, games and payment — without installation and without sign-up, because Telegram already knows the user. It is built with any web technology; Telegram adds a JavaScript bridge to its interface — the main button, the theme, haptics, storage, payments. The key rule of security: user data arrives signed by Telegram and is checked only on the server. Digital goods inside Telegram are paid in Telegram Stars, physical goods and services — through payment providers. The cost is dependence on the platform: its rules, its review and no visibility in search.
Telegram Mini Apps at a glance
The main facts about the platform in one table.
- What it is
- A web application that opens inside Telegram through a bot
- Since
- 2022 (Bot API 6.0); full-screen mode and home-screen shortcuts since 2024
- Audience
- Telegram — over a billion monthly users
- Technologies
- Any web stack: HTML, CSS, JavaScript or TypeScript, React, Vue
- Bridge to Telegram
Telegram.WebAppfrom telegram-web-app.js or the @telegram-apps/sdk package- Sign-in
- Without a password: Telegram passes signed user data —
initData - Interface
- Main and secondary buttons, back button, theme colours, haptics, full screen
- Storage
- CloudStorage in the user’s account; device and secure storage
- Payments
- Digital goods — Telegram Stars; physical goods and services — payment providers
- Launch
- Menu button, a button in a message, a direct link t.me/bot/app, the attachment menu
- Where it runs
- Telegram on iOS, Android, desktop and web
How a Mini App works
Four parts — and the third one is where most security mistakes happen.
-
A bot
Created in BotFather; it gives the Mini App a name, a link and a place in the menu.
-
A web page
Your interface on HTTPS — any stack, usually React or plain HTML with a little JavaScript.
-
Signed data
Telegram passes
initDatawith a signature; the server checks it before trusting the user. -
Your backend
Orders, payments, notifications and shared data with the site and the CRM.
What Mini Apps are used for: 8 areas
Where the audience already lives in Telegram and a chat window is not enough.
-
01
Shops and catalogues
Browse, filter, cart and pay without leaving the messenger.
-
02
Bookings
Services, specialists and free slots with reminders from the bot.
-
03
Personal accounts
Orders, bonuses and documents — sign-in without a password.
-
04
Loyalty programmes
A card with a code instead of plastic, points and offers.
-
05
Paid content
Courses, subscriptions and digital goods for Telegram Stars.
-
06
Games
Casual games with sharing and leaderboards among friends.
-
07
Internal tools
Forms and dashboards for staff who already use Telegram for work.
-
08
Communities and events
Registration, tickets and schedules for a channel’s audience.
Pros and cons of Telegram Mini Apps
A Mini App removes the main barriers to a first purchase — and puts the product on someone else’s platform.
Pros · 8
-
No installation
Opens from a link or a button in a second.
-
No sign-up
The user is already known — no forms and passwords before the first action.
-
The audience is already there
Channels, chats and bots bring people straight to the app.
-
Notifications through the bot
Order status and reminders arrive as messages people actually read.
-
Web technologies
The same skills and code as for a site; updates without app-store review.
-
Payments in two taps
Stars for digital goods and providers for physical ones.
-
Every platform at once
iOS, Android and desktop from one code base.
-
A native feel
The theme, buttons and haptics of Telegram make the app feel built in.
Cons · 8
-
Dependence on the platform
Telegram’s rules, fees and API changes apply to your product.
-
Not in search
Search engines do not index Mini Apps — you still need a site to be found.
-
Only Telegram users
Customers who do not use Telegram are not reached.
-
Stars for digital goods
Card payments are not allowed for digital goods inside Telegram.
-
Different web engines
iOS, Android and desktop clients render slightly differently — test on all.
-
Security mistakes are common
Trusting user data in the browser lets anyone pretend to be someone else.
-
Small screens
The interface lives in a phone panel — complex screens must be simplified.
-
Risk of blocking
In some countries access to Telegram is limited — the audience depends on it.
A Mini App compared with a bot, a website and a mobile app
Four ways to reach a customer, side by side.
| Criterion | Mini App | Chat bot | Website | Mobile app |
|---|---|---|---|---|
| Installation | none | none | none | from a store |
| Sign-up | none, through Telegram | none | a form | a form or a service |
| Interface | a full one | buttons and messages | a full one | the richest |
| Found in search | no | no | yes | in stores |
| Notifications | through the bot | messages | email and push | push |
| Development cost | medium | low | medium | high |
| Best for | an audience that lives in Telegram | simple scenarios | search and trust | products used every day |
Security of a Mini App: 6 rules
-
01
Check initData on the server
Only the signature check on your server proves who the user is.
-
02
initDataUnsafe is for display only
Use it for a greeting, never for access or prices.
-
03
Check the age of the data
auth_datelimits how long an intercepted signature works. -
04
Prices on the server
The browser sends what was chosen; the sum is calculated by the backend.
-
05
Confirm payments by the bot
Access opens after
successful_paymentarrives to the bot, not after a callback in the browser. -
06
The bot token in secret
It lives in the server environment; whoever has it controls the bot.
When a Mini App is worth it — and when not
Ten typical situations with a verdict.
-
The audience already comes from Telegram channels
Best fitThe shortest path from a post to a purchase.
-
Bookings and repeat orders
Best fitNo sign-up and reminders from the bot.
-
Paid courses and digital content
Best fitStars and access in two taps.
-
A loyalty card
Best fitAlways at hand in the messenger.
-
An app instead of a mobile one at the start
Best fitCheck demand before spending on native apps.
-
An online shop
WorksAs an extra channel next to the site, with shared stock.
-
A B2B service
WorksIf the clients’ teams work in Telegram.
-
The only channel of the business
Pick anotherWithout a site the business is not found in search and depends on one platform.
-
An audience outside Telegram
Pick anotherA site or a mobile app.
-
A complex tool for hours of work
Pick anotherA web app in the browser is more comfortable.
What a Mini App looks like: 3 examples
The page with Telegram’s theme and main button, the server check of the signature and an invoice in Stars. The page is run in Chromium with the real Telegram script, the PHP code is tested on PHP 8.5.
The Mini App page
The user’s theme, a greeting and the main button that leads to payment.
<!-- a Mini App is an ordinary web page that opens inside Telegram -->
<script src="https://telegram.org/js/telegram-web-app.js"></script>
<style>
/* Telegram passes the user's theme as CSS variables */
body { background: var(--tg-theme-bg-color, #fff); color: var(--tg-theme-text-color, #000); }
</style>
<h1>Premium course</h1>
<p id="hello"></p>
<script>
const app = Telegram.WebApp;
app.ready(); // the interface is ready: Telegram hides its loader
const name = app.initDataUnsafe.user?.first_name ?? 'guest';
document.getElementById('hello').textContent = `Hello, ${name}!`;
// the main button lives in Telegram's own interface, at the bottom of the screen
app.MainButton.setText('Buy for 50 ⭐').show().onClick(async () => {
// initData goes to the server: it checks the signature and creates the invoice
const res = await fetch('/api/invoice', { method: 'POST', body: app.initData });
const { link } = await res.json();
app.openInvoice(link, (status) => {
if (status === 'paid') app.showAlert('Thank you! Access is open.');
});
});
</script>
Checking the signature on the server
Real data passes; a changed name, another bot’s token and old data are rejected.
<?php
declare(strict_types=1);
// initData is signed by Telegram: check it on the server, never trust the browser
function verifyInitData(string $initData, string $botToken, int $maxAge = 3600): ?array
{
parse_str($initData, $fields);
$hash = $fields['hash'] ?? '';
unset($fields['hash']);
ksort($fields);
$check = implode("\n", array_map(fn($k, $v) => "$k=$v", array_keys($fields), $fields));
$secret = hash_hmac('sha256', $botToken, 'WebAppData', true);
if (!hash_equals(hash_hmac('sha256', $check, $secret), $hash)) {
return null; // forged or damaged data
}
if (time() - (int) ($fields['auth_date'] ?? 0) > $maxAge) {
return null; // the data is too old
}
return json_decode($fields['user'] ?? 'null', true);
}
An invoice in Telegram Stars
The server creates a payment link, and the page opens it with openInvoice.
<?php
declare(strict_types=1);
// an invoice in Telegram Stars: digital goods inside Telegram are paid only this way
function createStarsInvoice(string $botToken, string $title, int $stars, string $payload): string
{
$api = getenv('TG_API') ?: 'https://api.telegram.org';
$request = [
'title' => $title,
'description' => "Access: $title",
'payload' => $payload, // your order id, returned after payment
'currency' => 'XTR', // XTR = Telegram Stars
'prices' => [['label' => $title, 'amount' => $stars]],
'provider_token' => '', // empty for Stars
];
$context = stream_context_create(['http' => [
'method' => 'POST',
'header' => 'Content-Type: application/json',
'content' => json_encode($request),
]]);
$response = json_decode(file_get_contents("$api/bot$botToken/createInvoiceLink", false, $context), true);
if (!($response['ok'] ?? false)) {
throw new RuntimeException($response['description'] ?? 'Telegram API error');
}
return $response['result']; // a link for Telegram.WebApp.openInvoice()
}
Questions about Telegram Mini Apps
What is a Telegram Mini App?
A web application that opens inside Telegram through a bot — a full interface without installation and sign-up.
What is a Mini App written in?
On any web stack: usually React with TypeScript or plain HTML; the backend — any language.
How do payments work?
Digital goods — only in Telegram Stars; physical goods and services — through connected payment providers.
Is a Mini App found in search?
No. Search engines do not index them — a site is needed to be found.
How does the app know the user?
Telegram passes signed data; the server checks the signature with the bot token and trusts only checked data.
Can a Mini App share data with our site?
Yes, through one backend: orders, stock and customers are shared.
Does a Mini App work on a computer?
Yes, in Telegram Desktop and the web version, as well as on iOS and Android.
Mini App or a regular bot?
A bot is enough for buttons and messages; a Mini App is needed for a catalogue, a calendar or a cart.
Online form
Development
of Mini Apps
I build Telegram Mini Apps and bots: the interface on React and TypeScript, a backend that checks every signature, payments and shared data with your site. Tell me about the idea — I answer within one working day.