Take out the complexity. There’s lots of ways to define and build App or Web App, and in this case for Telegram Mini App. But for me it’s just the same. Its some kind of website with certain functionality for whatever purpose. And at certain level we could build it using WordPress. Creating Telegram Mini App using WordPress is just matter of integrate Telegram with our WordPress site.
Looking at the mini app trending in #telegram now, there’s couple of core function that we want to try to integrate:
1- Authentication – this includes registering user into our WordPress site using Telegram. Then for those already registered, logging in them using Telegram too. The good news is, Telegram offers seamless authentication especially when we use the Mini App. This means that whenever someone open your WordPress site via Mini App, they automatically got registered or logged in without doing anything. (Whether that’s a good or a bad thing, that’s a different topic for now).
2- Share & Invite – one of the main reasons we want to integrate with Telegram was because we want to utilize their user base, and share/invite function was important part of this.
3- Reward User – users been rewarded with token, coins, NFT and lots of things that I also don’t really understand yet. We would like to get this integrate too so that users are motivated to take action especially on share and invite above.
In this article, we will first cover on how to authenticate our WordPress site using Telegram. A simple flow will look like below. (Below steps assumed that your WordPress site is already ready, and you have some knowledge in both Telegram bot and WordPress.)
1- At Telegram, create a Telegram Bot. Get API token from the bot. We need this to use in our WordPress site. At the same time, we need to set Domain and Web App URL in the Telegram Bot. This is to whitelist our domain within our Telegram bot and set connection via Telegram WebApp.
2- At WordPress site, install WP Telegram Login plugin. Here you will paste your bot API token and make additional setup whichever you feel necessary. I recommend installing WP Telegram plugin too to utilize other Telegram integration with WordPress.
3- At Telegram, test out if your Mini App is working or not.