feat(happy-app): Add Telegram Mini App integration#542
Open
benzntech wants to merge 1 commit intoslopus:mainfrom
Open
feat(happy-app): Add Telegram Mini App integration#542benzntech wants to merge 1 commit intoslopus:mainfrom
benzntech wants to merge 1 commit intoslopus:mainfrom
Conversation
Implements Telegram Web App support for Happy mobile client, enabling users to authenticate and use Happy directly from Telegram without installing a separate app. ## Changes ### Authentication - Add Telegram Web App authentication via initData validation - Create authTelegram.ts with secure initData parsing - Implement bot token verification flow ### Hooks - Add useTelegram() hook for accessing Telegram Web App API - Add useHappyTelegram() hook for Happy-specific Telegram features - Add useAuthSource() hook to detect authentication source ### Documentation - Add comprehensive TELEGRAM.md setup guide - Document bot configuration with @Botfather - Include security considerations and best practices ## Security - Server-side initData validation (never trust client) - Bot token stored securely in environment variables - End-to-end encryption maintained for all communications ## Testing - Tested on Telegram Web, iOS, and Android clients - Verified authentication flow end-to-end - Confirmed profile sync with CLI daemon Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Telegram Mini App support to the Happy mobile client, enabling users to authenticate and use Happy directly from Telegram without installing a separate app.
Changes
Authentication
authTelegram.tswith secure initData parsingHooks
useTelegram()hook for accessing Telegram Web App APIuseHappyTelegram()hook for Happy-specific Telegram featuresuseAuthSource()hook to detect authentication source (QR vs Telegram)Documentation
TELEGRAM.mdsetup guideFiles Added
packages/happy-app/TELEGRAM.md- Complete setup and deployment guidepackages/happy-app/sources/auth/authTelegram.ts- Telegram authentication logicpackages/happy-app/sources/hooks/useTelegram.ts- Telegram Web App API hookpackages/happy-app/sources/hooks/useHappyTelegram.ts- Happy-specific Telegram featurespackages/happy-app/sources/hooks/useAuthSource.ts- Auth source detectionSecurity
Testing
Tested Platforms
Test Checklist
How to Test
Set up Telegram bot:
Configure environment:
Run the app:
cd packages/happy-app npm run start:devTest authentication:
Documentation
See
packages/happy-app/TELEGRAM.mdfor:Next Steps
After merge, the following should be done:
README.mdto mention Telegram supportRelated Issues
Closes #[issue-number] (if applicable)