Skip to content

DavisDmitry/telegram-webapps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typings for Telegram Mini Apps

Version License MIT npm

Telegram Bot API Version 7.2

CI Lint


About Telegram Mini Apps


Usage

Instal

via npm :

npm install telegram-webapps --save-dev

via yarn :

yarn add -D telegram-webapps

via pnpm :

pnpm add -D telegram-webapps

Use typings

Include 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()