Publishers · Getting started

Quick start (5 minutes)

Create an account, add your Mini App, create an ad block and show your first ad — step by step.

This page takes you from zero to your first ad on screen. No experience needed — just follow the steps in order. Every step tells you exactly where to click.

What you need

  • A Telegram Mini App (a web page opened inside Telegram).
  • Access to its HTML file (usually index.html).
  • 5 minutes.

The whole process

  1. 1

    Create a partner account

    Go to adsun.io/register and choose Partner — the card that says “Monetize your Mini App or bot”. Enter your email and a password, then confirm your email.

  2. 2

    Add your Mini App

    In the publisher panel open Platforms → Create platform → Telegram Mini App. Fill in the direct link, Web app URL and Bot ID. How to find these values →

  3. 3

    Create an ad block

    Open your platform and press Create block. Pick Reward if you want to give users something for watching (coins, lives, boosters). More about blocks →

  4. 4

    Copy the code

    Open the block and press the Block configuration button — the </> icon at the left of Edit. A window opens with your real block ID already inside. It looks like this:

    <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>
  5. 5

    Paste it into your app and call show()

    Put the first line (the <script> tag) inside <head>. Call AdController.show() when the user presses your “Watch ad” button.

  6. 6

    Test, then go live

    Add debug: true to see a test ad right away. When it works, remove it and publish. Your block goes Active after review and real ads start earning money.

IMPORTANT

Only give valuable rewards (money, coins that can be withdrawn) after Adsun calls your Reward URL. The browser alone can be faked.

A full working example

Copy this into an empty index.html, replace YOUR_BLOCK_ID and open it inside Telegram:

<!doctype html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://telegram.org/js/telegram-web-app.js"></script>
  <script src="https://api.adsun.io/sdk.js"></script>
</head>
<body>
  <button id="watch">Watch ad → +100 coins</button>

  <script>
    const AdController = window.Adsun.init({ blockId: "YOUR_BLOCK_ID", debug: true });

    document.getElementById("watch").addEventListener("click", () => {
      AdController.show()
        .then(() => alert("Thanks! Your reward is on the way."))
        .catch((result) => console.log("No reward:", result.description));
    });
  </script>
</body>
</html>

Still stuck? Write to support@adsun.io or our Telegram support — we answer fast.