https://github.com/fullpipe/twa-sdk-types
TypeScript package that provides type definitions for the Telegram Web Apps SDK
https://github.com/fullpipe/twa-sdk-types
telegram telegram-mini-app twa types
Last synced: about 1 month ago
JSON representation
TypeScript package that provides type definitions for the Telegram Web Apps SDK
- Host: GitHub
- URL: https://github.com/fullpipe/twa-sdk-types
- Owner: fullpipe
- License: mit
- Created: 2025-04-11T14:25:09.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-14T19:20:04.000Z (3 months ago)
- Last Synced: 2025-08-09T17:56:15.244Z (about 2 months ago)
- Topics: telegram, telegram-mini-app, twa, types
- Language: TypeScript
- Homepage:
- Size: 233 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Types for Telegram Web Apps (TWA) SDK
[](https://core.telegram.org/bots/webapps)
[](https://www.npmjs.com/package/twa-sdk-types)`twa-sdk-types` is a TypeScript package that provides type definitions for the Telegram Web Apps SDK.
## Usage
Install
```sh
npm install twa-sdk-types
```Declare in `global.d.ts`
```ts
import { Telegram } from 'twa-sdk-types';declare global {
interface Window {
Telegram: Telegram;
}
}
window.Telegram.WebApp.HapticFeedback.notificationOccurred('success');
```## Versioning and Updates
Major and minor versions of the package will be synchronized with the SDK.
For example:
- `SDK v9.0` => `twa-sdk-types@9.0.*`
All fixes within a specific SDK version (e.g., `v9.0`) will be published as patch updates.
## Update and generate
rebuild types
```sh
deno --allow-env --allow-read --allow-net --allow-write scrape/main.ts
npx prettier -w src/*
```Build
```sh
npm run build
```Publish or patch
```sh
npm version patch
npm publish
```## Todo
- [ ] Update and generate with github cron actions