Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/davisdmitry/telegram-webapps
- Owner: DavisDmitry
- License: mit
- Created: 2023-01-13T14:34:07.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T21:48:09.000Z (25 days ago)
- Last Synced: 2024-12-15T14:05:47.364Z (10 days ago)
- Topics: mini-apps, telegram, telegram-bot, telegram-mini-apps, telegram-web-apps, typescript
- Homepage: https://npmjs.com/package/telegram-webapps
- Size: 95.7 KB
- Stars: 72
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
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()
```