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 months ago
JSON representation
TypeScript typings for Telegram Mini Apps
- Host: GitHub
- URL: https://github.com/davisdmitry/telegram-webapps
- Owner: DavisDmitry
- License: mit
- Created: 2023-01-13T14:34:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-17T05:16:13.000Z (over 1 year ago)
- Last Synced: 2025-03-28T14:06:50.485Z (about 1 year ago)
- Topics: mini-apps, telegram, telegram-bot, telegram-mini-apps, telegram-web-apps, typescript
- Homepage: https://npmjs.com/package/telegram-webapps
- Size: 118 KB
- Stars: 84
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Typings for 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()
```