{"id":21676648,"url":"https://github.com/revenkroz/telegram-web-app-bot-example","last_synced_at":"2025-05-14T22:07:21.464Z","repository":{"id":65267865,"uuid":"482329859","full_name":"revenkroz/telegram-web-app-bot-example","owner":"revenkroz","description":"Telegram Web App (Mini App) for Bot Example","archived":false,"fork":false,"pushed_at":"2024-11-23T17:02:37.000Z","size":45,"stargazers_count":828,"open_issues_count":1,"forks_count":598,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-11T10:01:21.878Z","etag":null,"topics":["example-project","mini-app","telegram","telegram-bot","tutorial","web-app","webapp"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revenkroz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-16T18:21:00.000Z","updated_at":"2025-04-10T19:39:49.000Z","dependencies_parsed_at":"2023-01-16T02:31:05.493Z","dependency_job_id":"e077be8b-e8fb-42a3-bc2c-0fc7a4a84d13","html_url":"https://github.com/revenkroz/telegram-web-app-bot-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revenkroz%2Ftelegram-web-app-bot-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revenkroz%2Ftelegram-web-app-bot-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revenkroz%2Ftelegram-web-app-bot-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revenkroz%2Ftelegram-web-app-bot-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revenkroz","download_url":"https://codeload.github.com/revenkroz/telegram-web-app-bot-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235695,"owners_count":22036963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["example-project","mini-app","telegram","telegram-bot","tutorial","web-app","webapp"],"created_at":"2024-11-25T14:15:30.253Z","updated_at":"2025-05-14T22:07:16.422Z","avatar_url":"https://github.com/revenkroz.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Web Apps for Bots / Mini App Example\n\nExample HTML-file that contains a plain-JS interaction with Telegram Web Apps API. \nSee live demo (with jQuery): [Attach Bot](https://t.me/asmico_attach_bot).\n\n## Links\n* Official docs: https://core.telegram.org/bots/webapps\n* Live Demo Bot: [Attach Bot](https://t.me/asmico_attach_bot)\n* Telegram Promo Bot: [Durger King](https://t.me/durgerkingbot)\n\n## Quick setup\n\n#### 0. Optional: Host the Web App in GitHub Pages\n\nThe Web App must be hosted somewhere. Hosting it on a GitHub repository is a quick, free way to do it:\n\n1. Create a repository (or fork this one)\n2. On the repository: Settings –\u003e Pages:\n    - Source: Deploy from a branch\n    - Branch: master, / (root), Save\n3. Wait a few minutes for the web to be deployed. It will be available at: `https://{github-username}.github.io/{repository-name}/{location-inside-repository}`. In this case: `https://revenkroz.github.io/telegram-web-app-bot-example/index.html`\n\n#### 1. Show the user a button to open a Web App. There are two ways:\n\n1. Show the user a special menu button (near the message input field):\n   1. Go to [Bot Father](https://t.me/BotFather)\n   2. Select your bot\n   3. To set button in Bio: `Bot Settings` — `Configure Mini App`\n   4. Send a URL to your Web App (in this case, `https://revenkroz.github.io/telegram-web-app-bot-example/index.html`)\n   5. To set corner button in Bot: `Bot Settings` — `Menu Button` — `Specify..`/`Edit menu button URL`\n   6. Send a URL to your Web App (in this case, `https://revenkroz.github.io/telegram-web-app-bot-example/index.html`)\n\n2. The second way is to send a button with the data that contains field `web_app` with a URL to a Web App:\n    ```json\n    {\n        \"text\": \"Test web_app\",\n        \"web_app\": {\n            \"url\": \"https://revenkroz.github.io/telegram-web-app-bot-example/index.html\"\n        }\n    }\n    ```\n\n#### 2. Add script to your Web App\n\nTo connect a Web App to the Telegram client, place the script `telegram-web-app.js` in the `\u003chead\u003e` tag before any other scripts, using this code ([more info](https://core.telegram.org/bots/webapps#initializing-web-apps)):\n```html\n\u003cscript src=\"https://telegram.org/js/telegram-web-app.js\"\u003e\u003c/script\u003e\n```\n\nOnce the script is connected, a `window.Telegram.WebApp` object will become available.\n\n#### 3. Do the thing!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevenkroz%2Ftelegram-web-app-bot-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevenkroz%2Ftelegram-web-app-bot-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevenkroz%2Ftelegram-web-app-bot-example/lists"}