telegam miniapp (webapp) with php/js | how it works?
- How miniapp works
- How data is sent from frontend to backend in telegram miniapp
- How to ensure the authenticity of the data in telegram miniapp
- How do we know that you are the user you claim to be in telegram miniapp
- How to validate miniapp received data in php
First of all, I should say that this is an example with php. You can implement it in any language you like.
MiniApp is a feature of telegram that provides a GUI for bots.
- user opens the mini app.
- client sends a request to Telegram servers and receives the signed data.
- client sends the user information along with the received signatures to the web app.
- web app sends the signed data to the bot servers.
- bot servers have the token with them.
- Using the token, they decode this data and send the requested information to the webapp according to the chatID.
- web app receives this data and displays it to the user.
- set your bot token in
back.php
- If you want to change the path of the
back.php
file, you must also change the api path inminiapp.js
line308
- in
back.php
you can return whatever you want
if the repository was useful, star repository