Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twa-dev/sdk
npm package for TWA SDK
https://github.com/twa-dev/sdk
react sdk telegram telegram-bot twa-dev
Last synced: 1 day ago
JSON representation
npm package for TWA SDK
- Host: GitHub
- URL: https://github.com/twa-dev/sdk
- Owner: twa-dev
- License: mit
- Created: 2022-08-16T07:08:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T20:27:21.000Z (3 months ago)
- Last Synced: 2024-11-24T09:14:11.203Z (28 days ago)
- Topics: react, sdk, telegram, telegram-bot, twa-dev
- Language: JavaScript
- Homepage: https://codesandbox.io/s/sdk-kj5961
- Size: 120 KB
- Stars: 245
- Watchers: 5
- Forks: 21
- Open Issues: 13
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ton - twa-dev/sdk - npm package for TWA SDK. (🧑💻 Get Coding / Dev Tools)
README
## SDK
[![npm version](https://img.shields.io/npm/v/@twa-dev/sdk)](https://www.npmjs.com/package/@twa-dev/sdk)npm package for [Telegram Web Apps (TWA)](https://core.telegram.org/bots/webapps) SDK.
```
npm i @twa-dev/sdk
```### Motivation
Telegram distributes SDK via [link](https://core.telegram.org/bots/webapps#initializing-web-apps). It's kinda old fashion way to work with a library:```html
TWA
window.Telegram.WebApp.showAlert('Hey there!');
```
This package allows to work with SDK as with a npm package:
```js
import WebApp from '@twa-dev/sdk'WebApp.showAlert('Hey there!');
```And yes, it supports TS.
### Demo
[Codesandbox](https://codesandbox.io/s/sdk-kj5961)### React
If you use React in your project, check out components that we have prepared for you.
- [MainButton](src/react/MainButton/Readme.md)
- [SecondaryButton](src/react/SecondaryButton/Readme.md)
- [BottomBar](src/react/BottomBar/Readme.md)
- [BackButton](src/react/BackButton/Readme.md)These components significantly simplify developer experience.