Urgent.News

What's breaking now, across thousands of outlets.

Tech

One Inline Button for Everyone: Parameters, Authentication, and Callbacks in a Telegram Mini App

The code examples in this series are written in C#/.NET 10 (since that's what our production uses), but this article is about Telegram mechanics, not the language. The exact same architecture can be built on Node.js, Python, or Go without changes. That easily transferable mechanic is exactly why this article was written. What is this article about? This is the second part of a series on how we…

This article is the second part of a series on developing a bridge from Telegram to video conferencing services like Google Meet, Zoom, and others. The focus is on the session mechanism that connects a chat, a mini app, and an external browser into a single application. The main issues discussed are the shared button for everyone, the need for authentication and callbacks, and the fact that part of the flow leaves for an external browser, leaving only what was put into the URL.

The solution involves using server-side sessions, which act as a full-fledged equivalent of a classic web session, a dictionary with a TTL in memory, and a background worker to remove expired entries. The key is a random Guid, which acts as a secret, and the GetData<T>() method allows retrieving session-specific data. The session mechanism is mandatory for any scenario where the user leaves the mini app and comes back.

The chain involves three sessions: a RequestCall shared for the call, an AccessToken session for each user, and the target page with the personal token in the URL.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 14 August →