Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davisdmitry/telegram-webapps

TypeScript typings for Telegram Mini Apps
https://github.com/davisdmitry/telegram-webapps

mini-apps telegram telegram-bot telegram-mini-apps telegram-web-apps typescript

Last synced: 3 days ago
JSON representation

TypeScript typings for Telegram Mini Apps

Awesome Lists containing this project

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` :

```bash
npm install telegram-webapps --save-dev
```

via `yarn` :

```bash
yarn add -D telegram-webapps
```

via `pnpm` :

```bash
pnpm add -D telegram-webapps
```

### Use typings

Include the types file inside your [ `tsconfig.json` ](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) file like this:

```diff
{
"compilerOptions": {
"types": [
+ "./node_modules/telegram-webapps"
]
}
}
```

Use `Telegram` constant inside your client-side code to get `WebApp` object:

```typescript
// informs the Telegram app that the Web App is ready to be displayed
Telegram.WebApp.ready()
```