You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Telegram Mini Apps (TMA) are web applications that run inside the Telegram messenger. They are built using web technologies — HTML, CSS, and JavaScript. Telegram Mini Apps can be used to create DApps, games, and other types of apps that can be run inside Telegram.
3
+
Telegram Mini Apps (TMA) are web applications that run inside the Telegram messenger. They are built using web technologies—HTML, CSS, and JavaScript. Telegram Mini Apps can be used to create DApps, games, and other types of apps that can be run inside Telegram.
4
4
5
5
## Create your App
6
6
7
-
1. To connect your Mini App to Telegram, place the SDK script `telegram-web-app.js` using this code:
7
+
1. To connect your Mini App to Telegram, add the SDK script `telegram-web-app.js` using this code:
It's preferable to switch off cache in the HTML. To ensure your cache is switched off, specify headers in your request according to the following:
13
+
It's best to disable caching in the HTML. To ensure your caching is turned off, specify these headers in your request:
14
14
15
15
```curl
16
16
Cache-Control: no-store, must-revalidate
@@ -19,43 +19,43 @@ Expires: 0
19
19
```
20
20
:::
21
21
22
-
2. Once the script is connected, a**[window.Telegram.WebApp](https://core.telegram.org/bots/webapps#initializing-web-apps)** object becomes available. You can read more about creating Mini App utilizing[`telegram-web-app.js`](/v3/guidelines/dapps/tma/tutorials/app-examples#basic-tma-example) here.
22
+
2. Once the script is connected, the**[window.Telegram.WebApp](https://core.telegram.org/bots/webapps#initializing-web-apps)** object becomes available. Learn more about creating Mini App using[`telegram-web-app.js`](/v3/guidelines/dapps/tma/tutorials/app-examples#basic-tma-example) here.
23
23
24
-
3.The modern way to connect SDK is an NPM package for Telegram Mini Apps SDK:
24
+
3.You can also connect the SDK using the NPM package for Telegram Mini Apps SDK:
25
25
26
26
```bash npm2yarn
27
27
npm i @twa-dev/sdk
28
28
```
29
29
30
-
You can find a guide for [`@twa-dev/sdk`](/v3/guidelines/dapps/tma/tutorials/app-examples#modern-tma-example) here.
30
+
Find a guide for [`@twa-dev/sdk`](/v3/guidelines/dapps/tma/tutorials/app-examples#modern-tma-example) here.
31
31
32
-
5.When your Mini App is ready and deployed to the web server, follow to the next step.
32
+
5.Once your Mini App is ready and deployed to a web server, move on to the next step.
33
33
34
34
## Setting Up a Bot for the App
35
35
36
-
To connect your Mini App to Telegram, you need to create a bot and set up a Mini App for it. Follow these steps to set up a new Telegram bot:
36
+
To connect your Mini App to Telegram, you need to create a bot and set up a Mini App for it. Follow these steps:
37
37
38
38
### 1. Start a Chat with BotFather
39
39
40
40
- Open the Telegram app or web version.
41
-
- Search for `@BotFather` in the search bar or follow the link [https://t.me/BotFather](https://t.me/BotFather).
42
-
- Start a chat with BotFather by clicking on the `START` button.
41
+
- Search for `@BotFather` in the search bar or click this link [https://t.me/BotFather](https://t.me/BotFather).
42
+
- Start a chat with BotFather by clicking `START`.
43
43
44
44
### 2. Create a New Bot
45
45
46
-
- Send `/newbot` command to BotFather.
47
-
-BotFather will ask you to choose a name for your bot. This is a display name and can contain spaces.
48
-
-Next, you'll be asked to choose a username for your bot. This must end in `bot` (e.g., `sample_bot`) and be unique.
46
+
- Send the `/newbot` command to BotFather.
47
+
-Choose a name for your bot (this is a display name and can contain spaces).
48
+
-Choose a username for your bot (must end in `bot`, e.g., `sample_bot`, and be unique).
49
49
50
50
### 3. Set Up Bot Mini App
51
51
52
-
- Send `/mybots` command to BotFather.
53
-
-Choose your bot from the list and the**Bot settings** option
54
-
-Choose**Menu button** option
55
-
- Choose **Edit menu button URL**option and send URL to your Telegram Mini App, for example link from GitHub Pages deploy.
52
+
- Send the `/mybots` command to BotFather.
53
+
-Select your bot from the list and choose**Bot settings**.
54
+
-Select**Menu button**.
55
+
- Choose **Edit menu button URL** and send URL to your Telegram Mini App (e.g., a link from GitHub Pages deployment).
56
56
57
-
### 4. Accessing the Bot
57
+
### 4. Access the Bot
58
58
59
-
-You can now search for your bot using its username in Telegram's search bar.
60
-
-Press the button next to attach picker to launch your Telegram Mini App in messenger
59
+
-Search for your bot using its username in Telegram's search bar.
60
+
-Click the button next to attach picker to launch your Telegram Mini App in messenger.
0 commit comments