Embedding the portal in Telegram Mini Apps
Learn how to embed your Domino community portal within Telegram Mini Apps, handle authentication properly, and configure the necessary settings for seamless integration.
Overview
Telegram Mini Apps provide a seamless way to integrate web applications directly into the Telegram ecosystem. By embedding your Domino community portal in a Mini App, you can offer your Telegram community direct access to quests, leaderboards, and other community features without leaving the Telegram interface.
This integration requires special handling due to the unique authentication requirements and technical constraints of the Telegram Mini App environment. The portal automatically detects when it's running inside a Mini App and adjusts its behavior accordingly.
Understanding Telegram Mini App Authentication
Telegram Mini Apps have a unique authentication system that differs from standard web applications. When users access your Mini App, Telegram provides initialization data that must be forwarded to your portal for proper user identification and session management.
Key Authentication Concepts
Init Data: Telegram automatically generates user authentication data when the Mini App loads
URL Hash Fragment: Authentication data must be passed through the URL hash (
#) for securityNo SSR Parameter: Server-side rendering must be disabled for proper Mini App functionality
External Browser Flow: Social media connections require opening external browser windows
Portal Configuration for Mini Apps
Before embedding your portal, you need to configure it properly in the Domino dashboard.
Setting Up Authentication Methods
Navigate to your portal settings and configure the authentication tab:
Access Portal Settings from your community dashboard
Go to the Authentication tab
Enable the social login methods your community needs:
Discord: For Discord-based quests and verification
Twitter: For Twitter engagement quests
Configure wallet login options if you have crypto-related quests
Bot ID Configuration
Your Telegram Mini App's bot must be configured in your portal settings to enable proper integration:
In your portal settings, navigate to the Authentication tab
Locate the Telegram Bot ID field
Enter your bot's unique identifier
Click Save to apply the configuration
This ensures the portal recognizes and properly handles requests from your specific bot, providing an additional layer of security.
Basic Embedding Implementation
Here's the essential code structure for embedding your portal in a Telegram Mini App:
Critical Parameters Explained
nossr=true: Disables server-side rendering, which is required for proper Mini App functionalityHash forwarding: The
location.hashcontains Telegram's authentication data and must be passed to the portal
Advanced Configuration Options
Custom Quest Targeting
You can embed specific quest pages or sections of your portal:
Dynamic URL Construction
For more complex implementations, you can dynamically construct the portal URL based on user context:
Handling Social Media Connections
Due to Telegram Mini App constraints, social media authentication flows (Discord, Twitter) will open in external browser windows rather than inline popups.
User Experience Flow
User clicks connect: Portal detects Mini App environment
External browser opens: Authentication happens in device's default browser
Return to Mini App: User manually returns to the Mini App after authentication
Automatic sync: Portal detects the new connection and updates the interface
Troubleshooting
Common Issues and Solutions
Last updated