serejaris/telegram-skills / skills/tg-miniapp-launch-auth
tg-miniapp-launch-auth
VerifiedUse when choosing how a Telegram Mini App opens (keyboard, inline or menu button, main app, direct link, startapp, join request) or when a server must trust a Mini App user: validating initData by HMAC or Ed25519, signature in the check string, auth_date, isVersionAtLeast gating, origin protection, test environment and debugging.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.0 KB |
| references/testing-debug.md | markdown | 2.3 KB |
| scripts/init_data.py | script | 2.9 KB |
| tests/test_ed25519.py | script | 1.2 KB |
| tests/test_init_data.py | script | 5.7 KB |
| tests/vectors.py | script | 1.1 KB |
tests/vectors.py
View on GitHubfrom urllib.parse import quote
TOKEN = 'test-token-not-a-real-bot'
OTHER_TOKEN = 'other-test-token-not-a-real-bot'
BOT_ID = 1000001
AUTH_DATE = 1700000000
CHAT_INSTANCE = '1000003'
PUBLIC_KEY = '021c5fa975dba9e91686148317ddbedcb7dd0913ed407fd5686fa11edb319bd6'
SIGNATURE = 'zrfDJAaAko0BaJ45zj_7L8pEEuKtIs-VLVhRMfYt8AJ5WRANhmsHoAMcuxkK4V_5j9u1b3qniw_aKKQu4cbTCQ'
SIGNED_HASH = 'dfbe54f85b4a08c63dd070e0494d00d792a7c7413a0474e390af61cc4ada8046'
USER = ('{"id":1000002,"first_name":"Test + - ? \\/","last_name":"User","username":"example_user",'
'"language_code":"en","is_premium":true,"allows_write_to_pm":true,'
'"photo_url":"https:\\/\\/example.com\\/avatar.svg"}')
SIGNED_INIT_DATA = (f'user={quote(USER, safe="")}&chat_instance={CHAT_INSTANCE}&chat_type=private'
f'&auth_date={AUTH_DATE}&signature={SIGNATURE}&hash={SIGNED_HASH}')
PLAIN_USER = '{"id":1000002,"first_name":"Test"}'
PLAIN_HASH = '9b6a56a25937df89fcd15f79ef3bf7fd03582fc7b55ba09273709120caea3f2f'
PLAIN_INIT_DATA = (f'query_id=test-query&user={quote(PLAIN_USER, safe="")}'
f'&auth_date={AUTH_DATE}&hash={PLAIN_HASH}')
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |