Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

telegram-webapps

DavisDmitry3.9kMIT8.0.5TypeScript support: included

Typings for Telegram Mini Apps

telegram, telegram-webapps, telegram-web-apps, telegram-miniapps, telegram-mini-apps, telegram-bot, typescript, types, typings

readme

Typings for Telegram Mini Apps

Version License MIT npm

Telegram Bot API Version 8.0

CI Lint


About Telegram Mini Apps


Usage

Installation

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": {
    "types": [
+     "./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()