Skip to content

Creating New App

In this article, we will delve into the process of developing a new application on the Telegram Mini Apps platform, we will find out exactly what actions need to be performed to create it, as well as give advice on improving the process of creating an application.

The process of creating an application usually consists of the following basic steps:

  1. Creating Telegram bot and registering Mini App.
  2. Creating web application.
  3. Getting web application URL and setting it via BotFather.

Before Starting

Before creating a new Mini App, you need to remember an important rule: do not create entities related to development in the production environment. Development within the production environment is a sign of bad taste, so use it strictly if you can't avoid it.

To create an application we should use test environment. You can learn more about switching to it in this article.

Speaking of advantages a developer gets from the test environment, it is important to mention an opportunity of usage of HTTP links instead of HTTPS, as well as IPs directly. Production environment allows usage only valid HTTPS links.

Creating Application in BotFather

As long as technically, Mini Apps are connected with Telegram bots, we should firstly create a Telegram bot. To do this, you need to find the father of all bots, the bot BotFather and use the command /newbot, then go through the proposed process, specifying all the necessary data.

When the bot is created, it is required then to use the command /newapp and again go through the procedure of creating another entity - the Telegram Mini Apps application, linking it to the Telegram bot. From now on, the created application will be available via a direct link of the form https://t.me/{mybot}/{myapp}.

INFO

Telegram Mini Apps technology can also be utilized without creating a new application but rather as a web interface for a bot. To use it as an extension of the bot, use the BotFather's /setmenubutton command.

Before reading this section, make sure that you have already created a frontend application that can be accessed via a direct link.

Obtaining

To learn more about obtaining a link for your Mini App, refer to this article.

Applying

When HTTPS link is received, it must be used in a previously created Telegram bot. Telegram supports several ways to install this link:

  • For the bot menu button. Then every user who will enter a dialogue with the bot will be able to open its "menu" in the form of a developed application.
  • For Telegram Mini Apps application. Then the application will open only if the user follows the link in format https://t.me/{mybot}/{myapp}. In this case, user can avoid joining a dialogue with the bot.

To set the link on the menu button, you need to go to the dialog with BotFather and use the command (send a message) /setmenubutton. Next, BotFather will ask you to select a bot, specify a link, as well as a title for the menu button.

As a result, when a user enters a chat with a bot, he will be able to open a web application by clicking on the menu button on the bottom left in the interface.

To install a direct link to the application, you must complete the following steps:

  1. Send the BotFather command /myapps.
  2. Select the required application.
  3. Click Edit link and install a new link.

Now when the user clicks on a link in format https://t.me/{mybot}/{myapp}, Telegram will display the web component with the source address as the URL specified in the settings.

Debugging Application

Sometimes, it is necessary to debug the developed application. To learn more, refer to this article.

Released under the MIT License.