How do you create a Telegram Mini App (Web App)?
Build a Telegram Mini App: create a bot, build a web app with telegram-web-app.js, host it on HTTPS, register it with BotFather (/newapp or menu button), validate initData, add payments and monetize with the Adsun SDK.

Content owner: Adsun Editorial & Ad Operations Team · Last verified:
Quick answer
A Telegram Mini App is a web app that opens inside Telegram. To create one, make a bot with @BotFather, build your app with any web stack (HTML/JS, React, Vue), include Telegram’s telegram-web-app.js script to read the user, theme and viewport, host it on an HTTPS URL, and connect it to the bot with /newapp or as the bot’s menu button. Validate initData on your server, add Stars payments or TON Connect if needed, and monetize with Adsun Reward, Interstitial and Task blocks through the Adsun SDK.
Key takeaways
- Mini Apps are normal web apps running inside Telegram.
- telegram-web-app.js gives access to user, theme, buttons and haptics.
- Always validate initData on the server.
- The Adsun SDK adds rewarded, interstitial and task ads in minutes.
Build steps
- Create a bot in @BotFather.
- Build a responsive web app (React, Vue, Svelte or plain JS).
- Add <script src="https://telegram.org/js/telegram-web-app.js"> and call Telegram.WebApp.ready().
- Host on HTTPS (any static host or server).
- Register with /newapp or set the bot menu button URL.
- Open the app from the bot and test on iOS, Android and desktop.
Essential features
- Server-side validation of initData.
- Theme colours and safe areas from Telegram.WebApp.
- MainButton and BackButton for native feel.
- Telegram Stars payments for digital goods.
- TON Connect for wallet features.
Monetize with Adsun
Create a free publisher account at adsun.io, add your Mini App or bot, create Reward, Interstitial or Task blocks, paste the SDK or bot snippet and watch earnings per block and country. Payouts are in USDT.
Use debug mode while testing — it is never billed — and the server-to-server Reward URL for rewards.
Get your first users
Create a free advertiser account at adsun.io, top up in USDT, choose Network or Native Ads, target countries and languages, bid on CPM or CPC and launch after review. Current minimums are on the pricing page.
Metric definitions and formulas
- CPM
- Cost per mille: what an advertiser pays for 1,000 ad impressions.
CPM = (Ad spend ÷ Impressions) × 1,000 - CPC
- Cost per click: average price an advertiser pays for one click.
CPC = Ad spend ÷ Clicks - CTR
- Click-through rate: the share of impressions that produced a click.
CTR = (Clicks ÷ Impressions) × 100% - eCPM
- Effective CPM: what a publisher earns per 1,000 impressions, whatever the pricing model.
eCPM = (Publisher earnings ÷ Impressions) × 1,000 - Fill rate
- The share of ad requests that returned an ad.
Fill rate = (Filled ad requests ÷ Total ad requests) × 100%
More terms in the glossary and the advertising metrics guide.
Worked example
Hypothetical example — not real Telegram or Adsun data
A new Mini App reaches 5,000 daily active users. Each user sees 3 rewarded ads a day = 15,000 impressions. At a $1.20 eCPM: 15,000 ÷ 1,000 × $1.20 = $18 per day, about $540 a month. The owner spends $100 on an Adsun CPC campaign at $0.05 per click = 2,000 clicks; 40% open the app = 800 new users, cost per user = $0.125. Replace every figure with your own data.
Adsun measurement methodology
Adsun counts an impression when an ad is rendered in a publisher block, a click when the user opens the ad destination, and a reward only after the server-to-server Reward URL confirms completion. Debug-mode traffic is excluded from billing and reports. Metrics are shown per platform, block and country in the partner and advertiser dashboards. Adsun does not publish aggregate network benchmarks in this guide; any number below marked “Hypothetical” is illustrative only. See the SDK documentation for integration details.
About Adsun
Adsun is a Telegram advertising network operated by Adsun. Products: Rewarded ads, Interstitial ads, Task ads, Native ads. Platforms: Telegram Mini Apps, Telegram bots, Telegram channels. Learn more about Adsun.
Start earning or growing with Adsun
Publishers earn USDT from Mini Apps, bots and channels. Advertisers reach Telegram users with CPM or CPC campaigns.
Frequently asked questions
What language are Telegram Mini Apps written in?
Any web technology: HTML, CSS and JavaScript or frameworks like React and Vue. The backend can be any language.
Is a Mini App the same as a Web App?
Yes. Telegram’s documentation calls them Web Apps; they are widely known as Mini Apps.
How do Mini Apps make money?
With ads (for example Adsun Reward and Interstitial blocks), Stars purchases, subscriptions and sponsorships.
Sources
- Telegram — Mini Apps (Web Apps) documentation
- Telegram — Bot API reference
- Telegram — Official Ad Platform
- Telegram — Payments with Telegram Stars
- IAB Tech Lab — Advertising standards and guidelines
- Media Rating Council — Measurement standards
- Telegram — FAQ
- Telegram — Bots: an introduction for developers
- Telegram — Telegram Stars
- TON — Documentation
- TON — Jetton standard (TEP-74)
- Adsun — SDK documentation
- Adsun — Publisher sign-up
- Adsun — Advertiser sign-up
Update log
- 2026-10-21: First published. Telegram and TON features are described generally; check telegram.org and docs.ton.org for current rules.