> For the complete documentation index, see [llms.txt](https://ton-play-1.gitbook.io/ton-play-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ton-play-1.gitbook.io/ton-play-1/get-started/telegram-webapp.md).

# Telegram WebApp

### About WebApp

1. WebApp is an option to open your web-based game inside Telegram Bot.
2. Telegram bots can completely replace **any website.**
3. All info about Telegram opportunities is here: [https://core.telegram.org](https://core.telegram.org/)

### Requirements

1. Backend developer
2. Ready-to-play game published on the website (**with** **SSL**)
3. [API Key](/ton-play-1/digital-assets-api/api-key.md)

### Checklist

This is a checklist for launching your game inside the Telegram WebApp:

* Create Telegram Bot via @BotFather: [t.me/BotFather](http://t.me/BotFather)
* Think about the logic of user actions. Create a Customer Journey Map
* Create your bot logic in Python, TypeScript, or any other language. Follow the recommendations [here](https://core.telegram.org/api/links#game-links)
* To get unique `bot_key`, check [https://console.tonplay.io ](https://console.tonplay.io)<br>

  <figure><img src="https://3521808686-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKzhU0vGPu8kmjYvMlj6r%2Fuploads%2F3u6Z5O0qy4aRvPizKVDt%2FScreenshot%202023-04-27%20at%203.33.39%20PM.png?alt=media&amp;token=2778e2b6-e7e4-44b4-ad0c-fcd63587c6e9" alt=""><figcaption></figcaption></figure>
* Link this domain \[[https://external.api.tonplay.io](https://external.api.tonplay.io/)] to the bot via `/setdomain` option in @BotFather
* Add an authorization method from [Auth API](/ton-play-1/digital-assets-api/auth-api.md)
* Add the `Play` button to your bot and use your game link to open the WebApp: <https://game.com/?token=jwtToken>
  * For a **web view** register your game via `/newgame` option in @BotFather. Then use `sendGame` for a user request with a game short name and user telegram ID.
  * For an **app view** use `sendWebApp` for a user request.
* Add inline to tag the game like @gamee → pop up with a picture and the `Play` button
* Suggest the user add a wallet via [Connect Wallet](/ton-play-1/digital-assets-api/connect-wallet.md)
* [Decode JWT](/ton-play-1/digital-assets-api/authentication/decode-jwt.md) to get info about the user, including the wallet balance
* Test your bot and WebApp
* Add an option to save the scores and create a leaderboard inside Telegram via [this guide](https://core.telegram.org/api/bots/games#setting-highscores)
