Last active
March 3, 2026 17:11
-
-
Save safra36/5dc49ee19f6b3546919a247bb26f3a2b to your computer and use it in GitHub Desktop.
Telegram mini-app authorization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // to use it on your webapp, simply create a backend with these functions, and use this to verify authorization | |
| fetch("/auth", { | |
| method : "POST", | |
| body : window.Telegram.WebApp.initData, | |
| }) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface TelegramUser { | |
| id: number; | |
| first_name: string; | |
| last_name: string; | |
| username: string; | |
| language_code: string; | |
| allows_write_to_pm: boolean; | |
| photo_url: string; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment