How telemetree/telemetree-pixel works
Main Components
a) Client-Side Components:
• Telemetree Pixel Core (Main SDK)
• Event Builders System
• Transport Layer
• Storage Management
• Telegram Web App Integration
• TON Connect Integration
b) External Systems:
• Telegram Web App Platform
• TON Blockchain
• Telemetree Backend Services
Key Architectural Elements
1. Integration Layer
• Telegram Web App Context
• TON Connect Integration
2. Core SDK Layer
• Event Builder System
• Hooks & Observers
• Configuration Management
3. Data Processing Layer
• Event Processing
• Encryption System
• Transport Management
4. External Services Layer
• Telemetree API
• Telegram Platform
• TON Blockchain
Specific Implementation Details
a) Event Flow:
• How events are created using the EventBuilder (src/builders)
• Flow through observers (src/observers)
• Demonstrate how events are processed and transported (src/transports)
b) Integration Points:
• Connection with Telegram Web App (src/telegram)
• TON Connect integration (src/observers/ton-connect.observer.ts)
• Tracking groups implementation (src/setup/trackGroups.ts)
Data Flow Representation
• Event creation → Event building → Transport
• Telegram Web App events → SDK processing
• TON Connect events → SDK processing
• Encrypted data → Telemetree Backend
Important Details to Highlight
• RSA encryption process for data transmission
• Different tracking groups (high, medium, low)
• Automatic event collection system
• Custom event tracking capabilities
Component Relationships
Clear connections between:
• Event builders and transport layer
• Observers and event processing
• Storage management and local data
• Configuration and feature toggles
Integration flexibility
• Component types
• Tracking group levels
Keep the abstraction level high enough to show the overall architecture while including crucial implementation details that make this SDK unique, such as the Telegram Web App integration and TON Connect support.