via npm :
npm install telegram-webappsvia yarn :
yarn add telegram-webappsInclude the types file inside your tsconfig.json file like this:
{
"compilerOptions": {
"typeRoots": [
+ "./node_modules/telegram-webapps"
]
}
}Use Telegram constant inside your client-side code to get WebApp object:
// informs the Telegram app that the Web App is ready to be displayed
Telegram.WebApp.ready()