Telegram Onboarding Kit is a simple-to-use tool for crafting onboardings and paywalls for Telegram Bots. You can create pretty onboardings with minimal adjustments to our presets or easily create your own custom flows with our web components β thanks to Telegram Mini Apps.
But why do you need it? Because onboarding/paywall is a must-have attribute of any mobile app β it offers a bright product presentation and seamless payment process. We believe Telegram Mini Apps will be used by millions of users in the future and this kit will help developers to turn their apps into real products!
To start:
demo.mp4
- Native support for images, videos, Telegram (.tgs) animated stickers, forms, feature lists and page navigation
- Configurable products on paywall
- One-click 0$ deploy on GitHub Pages
- Auto adaptation to Telegram color scheme
- Telegram Payments & π Wallet Pay payment methods
- Large library of UI components for custom builds
- Language and currency localization
- Buttons with haptic feedback
- Content pre-loading for smooth user experience
- Telegram-native design
- Many examples/presets (with free-to-use Figma project)
- Extensive documentation with visual examples
- MIT License (free for commercial use)
For a quick start you can watch video tutorial:
But if you prefer text:
- Fork this repository and clone it to your local machine
- Run command
npm ci
to install all the dependencies (make sure that you have installedpip
andnode
on your machine) - And now you're ready to run the app with
npm run dev
command - To run python bot put your tokens to
bot/.env
(usebot/example.env
as an example). Then start the bot withnpm run bot
command
The heart of this project lies in the configuration. By tweaking the configuration file, you can customize the onboarding experience according to your project's requirements. The configuration file can be found at config.ts.
For detailed information on configuring the app, refer to the Configuration Guide.
The perfect location for onboarding is right at the start of the bot. It will help you to brightly present your product to the user.
To integrate onboarding to your bot, you simply need to add a button with a link of your deployed onboarding web application. Telegram currently supports six different ways of launching Mini Apps. For onboadring launching we recommend using MenuButton or KeyboardButton.
MenuButton is a special button which appears on the left side of the text input (see @DurgerKingBot). This button can be configured without any server code in @BotFather:
- Go to @BotFather β
/mybots
β Select yout bot βBot Settings
βMenu Button
β Send your onboarding URL β Send button title (e.g. "Onboarding")
Now Menu Button with onboarding will appear in your bot.
Try KeyboardButton in action in our Demo Bot. It utilizes Telegram's KeyboardButton with Mini App URL inside.
Here's a snippet for reply_markup
implemented with python-telegram-bot library (see full implementation in bot.py):
reply_markup = telegram.ReplyKeyboardMarkup.from_button(
telegram.KeyboardButton(
text="π Onboarding",
web_app=telegram.WebAppInfo(url={ONBOARDING_URL})
)
)
Note: KeyboardButton does't send any user data to Mini App (e.g. language_code
). But you can send all the required data with HTTP GET parameters (see this function as reference).
Good ending of onboarding is a paywall: User selects a product β Chooses payment method β Gets invoice in the chat. After the paywall the bot receives data about the selected product like:
{
"title": "Title",
"description": "Description",
"price": 5.99,
"currency": "USD",
"payment_method": "wallet_pay"
}
This data is used for ivoice generation. We implemented 2 different payment methods: native Telegram Payments and π Wallet Pay (but generally any payment method can be integrated into such flow). You can find full code in bot.py:
- Telegram Payments: [send invoice] β’ [check payment status]
- π Wallet Pay: [send invoice] β’ [check payment status]
To help you understand how to create your own configuration, we provide multiple example applications in the ./examples
directory. Each example demonstrates different onboarding scenarios and includes a sample configuration file:
-
Base App
- Located in:
./app
- Key features:
various slide configurations
telegram-native design
onboarding from demo video
- Run command:
npm run dev
- Located in:
-
Fashion AI App
- Located in:
./examples/ai
- Key features:
interactive slides
currency configuration
vertical products on paywall
custom preset
- Run command:
npm run dev:ai
- Located in:
-
Meditation App
- Located in:
./examples/meditation
- Key features:
localization
custom icons
different image styles
custom preset
- Run command:
npm run dev:meditation
- Located in:
-
AI Tales App
- Located in:
./examples/tales
- Key features:
language/currency localization
interactive flow on onboarding
custom preset
- Run command:
npm run dev:tales
- Located in:
-
VPN App
- Located in:
./examples/vpn
- Key features:
app created during YouTube tutorial using base preset
- Run command:
npm run dev:vpn
- Located in:
-
ChatGPT App
- Located in:
./examples/chatgpt
- Key features:
onboarding for real bot @chatgpt_karfly_bot
videos
- Run command:
npm run dev:chagpt
- Located in:
A collection of essential UI components. Explore the potential of these components by visiting our Figma project, where you can see them in action and gain a better understanding of their capabilities.
This package offers a convenient wrapper around the @twa-dev/sdk, providing Vue-like components and use-case solutions for Popups, MainButton, BackButton, and Theme integration.
A minimalistic package for handling localization in your applications. We refrain from using third-party solutions due to concerns about the bundle sizes they introduce. While we provide this solution, feel free to replace it with your own if it better suits your needs.
The primary package for generating projects via a configuration file. It offers presets that can be easily extended within the configuration file.
A Node solution for image compression. It processes PNG, JPG, and JPEG files, compressing them and converting them into WEBP, PNG, JPG, or JPEG formats.
A basic ESLint configuration for vue projects to maintain clean and consistent code.
Shared tsconfig.base.json
file for vue + vite projects
A package for managing a monorepository. If you haven't heard of it, take a look at its documentation; it's worth it
A package for building and running modern web applications. Documentation
Vue is a JavaScript framework for building user interfaces. Documentation
NPM package for Telegram Mini Apps SDK. Take a look at their GitHub repository
Lottie is a mobile library for Web that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively!
For information on how sticker.tgs
files are rendered in this project, please refer to this link
- Konstantin Beskrovnyi β Web
- Karim Iskakov β Python/Product
- Michael Browk β Design
This project is licensed under the MIT License - see the LICENSE file for details.