diff --git a/.changeset/gentle-parrots-yawn.md b/.changeset/gentle-parrots-yawn.md new file mode 100644 index 000000000..3d2c7161c --- /dev/null +++ b/.changeset/gentle-parrots-yawn.md @@ -0,0 +1,5 @@ +--- +"@tma.js/sdk": patch +--- + +Update README.md diff --git a/packages/sdk/README.md b/packages/sdk/README.md index b3307386f..21ec9962a 100644 --- a/packages/sdk/README.md +++ b/packages/sdk/README.md @@ -28,4 +28,37 @@ the Telegram Mini Apps ecosystem. Before you begin using the SDK, we highly recommend familiarizing yourself with the Telegram Mini Apps [documentation](https://docs.telegram-mini-apps.com/platform/about) -to grasp the fundamental concepts of the platform. \ No newline at end of file +to grasp the fundamental concepts of the platform. + +## Installation + +```bash +# pnpm +pnpm i @tma.js/sdk + +# yarn +yarn add @tma.js/sdk + +# npm +npm i @tma.js/sdk +``` + +## Usage Example + +```typescript +import { init, backButton } from '@tma.js/sdk'; + +// Initialize all library dependencies. +init(); + +// Mount all required components used across the application. +// This will lead to components' state restoration. +backButton.mount(); +backButton.onClick(() => { + window.history.back(); +}); +``` + +## Documentation + +You can find complete documentation over the library [here](https://docs.telegram-mini-apps.com/packages/tma-js-sdk).