I a building an application that is to function as a webapp and also as a telegram Miniapp. Telegram miniapp has certain special functionalities or features like the initData ,ie the window.Telegram.WebApp.initData
and all available within it. To access these the webapp should be hosted a telegram miniapp, which requires the webapp to be live.
This is not convenient for development and testing purposes.
Is there a way in which i can maybe give my localhost link as the telegram miniapp and run that.
Or what's the best way for testing and development of Telegram miniapps.
This can be done using Ngrok
Reference Video : https://www.youtube.com/live/HewVC6tUC1w?feature=shared&t=466
Steps :
Goto ngrok.com and signup.
Install and configure ngrok using the steps provided at ngrok dashboard after signup.
Install ngrok npm package in your project.
Add this to your package.json under scripts
"ngrok":"ngrok http http://localhost:port-number"
NOTE : Use the port number your application is running on localhost of your system. If your application runs on localhost:3000
use port 3000
npm run dev
or npm run start
or whatever.npm run ngrok