Quick Start Guide
quick start guide with minimum required snippets and minimum API reference
This is a quick start guide, for the detailed information, please refer 3. For Publishers and 4. For Advertisers
Table of Contents
Overview
The TMA (Telegram Mini App) SDK allows you to integrate advertising functionality into your Telegram Mini App. This guide covers implementation across three different frameworks:
Vanilla JavaScript
Vanilla JavaScript Implementation
1. Include Required Scripts
Add the following to your HTML <head> section:
Find your hashed wallet address in the Snippets seciton of the web app.
2. Initialize the SDK
3. Add Offer Wall Button
React Implementation
1. SDK Integration
Create a component to handle SDK initialization:
2. Offer Wall Button Component
Next.js Implementation
1. Create BecScript Component
Create a new file components/BecScript.tsx:
2. Add to Layout
In your app/layout.tsx:
Common Features
Style Configuration
Configure the appearance of your offer wall:
Ad Blacklist Configuration
Block specific ads from appearing:
Ad Click Event Tracking
Monitor when users interact with ads:
User Conversion Tracking
Check user conversions using the API:
API Reference
User Conversion API Response
Function Reference
TE.onLoad()
Initializes the SDK
None
TE.offerWall()
Opens the offer wall
None
TE.configureOfferWallStyle()
Configures the offer wall appearance
StyleConfig object
TE.setBlacklistAds()
Sets the ad blacklist
Array of ad IDs or names
Event Reference
becLoaded
Fired when SDK is loaded
None
TEAdClicked
Fired when an ad is clicked
Ad details in event.detail
Last updated