Developer SDK · Updated
Telegram Mini App Ads SDK: Add Ads in 5 Minutes
Quick answer
The Adsun SDK adds rewarded, interstitial and task ads to a Telegram Mini App with one script tag and a few lines of JavaScript. You test with debug mode (never billed), verify rewards on your server with a Reward URL and get paid in USDT.
In short
- One script tag plus window.Adsun.init().
- Reward, Interstitial and Task formats.
- debug: true shows test ads that are never billed.
- Earnings in USDT, $100 minimum withdrawal.
Integrate in 5 minutes
Create a free publisher account, add your Mini App, create a block and paste the snippet the panel gives you — it already contains your real block ID.
<script src="https://api.adsun.io/sdk.js"></script>
<script>
const AdController = window.Adsun.init({ blockId: "YOUR_BLOCK_ID" });
AdController.show()
.then((result) => {
// user watched till the end: give the reward
})
.catch((result) => {
// skipped, no ad or error
});
</script>Reward, Interstitial and Task formats
Reward is a full-screen opt-in ad that unlocks an in-app reward, Interstitial is a full-screen ad between screens, and Task is a native row where the user completes an offer.
<script src="https://api.adsun.io/sdk.js"></script>
<script>
const AdController = window.Adsun.init({ blockId: "50001" });
AdController.show()
.then((result) => {
// user watched till the end: give the reward
})
.catch((result) => {
// skipped, no ad or error
});
</script>Debug mode (never billed)
Set debug: true while you build: the SDK serves test ads, logs events in the console and nothing is billed or paid.
Switch it to false before release. Optional debugBannerType forces a specific test creative.
Reward URL verification
A Reward URL lets Adsun call your server after a verified completion, so rewards are granted server-side and cannot be faked from the browser.
Payments
Publisher earnings are paid in USDT to your TON wallet; the minimum withdrawal is $100 and processing takes up to 3 days, usually the same day.
Open-source packages
The SDK is published as the adsun-sdk package on npm, with source on GitHub.
Add the SDK step by step
Step 1
Create a free publisher account.
Step 2
Add your Mini App (name and Web App URL).
Step 3
Create a Reward, Interstitial or Task block.
Step 4
Paste the snippet and test with debug: true.
Step 5
Set debug: false, publish and track earnings.
Frequently asked questions
Is the Adsun SDK free?
Yes. The SDK and publisher account are free; Adsun earns from advertisers.
Does it work outside Telegram?
No. The SDK is for Telegram Mini Apps (and bots via server requests), not for ordinary websites or native iOS/Android apps.
Is there a React or Vue example?
Yes — the documentation has copy-paste hooks and components for React, Vue 3 and Unity WebGL.
Are debug impressions paid?
No. Debug mode serves test ads that are never billed to advertisers or paid to publishers.
Do I need a Reward URL?
It is optional but recommended whenever a reward has real value; it confirms completions on your server.
When am I paid?
Publisher earnings are paid in USDT to your TON wallet; the minimum withdrawal is $100 and processing takes up to 3 days, usually the same day.
Sources
- adsun-sdk package — npm, checked
- adsun-io/adsun-sdk repository — GitHub, checked
Add the SDK — free
Publisher account, SDK and support are free. Support: @ADSunSupport on Telegram or support@adsun.io.
Add the SDK — free