I tried using WebApp.sendData
, but it closes the app. I guess I should use POST to send data from browser, but I don't know how do I make the backend know the telegram ID of a user whose Mini App sends this POST request.
I don't have any auth except authentication via Telegram. The app is launched via KeyboardButton
.
i've found these repos which implemented the exactly what telegram says in the documentation. But the backend written in go, so i didn't read it fully, you can check it out if you want:
user_id
inside the JWT payload, the user_id you have in the bot service on request from the Telegram bot.You can always expand on this idea; it's just a different concept that should work, and I think it's secure enough.
also here some article mb interesting, mb not:)