Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-parrots-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tma.js/sdk": patch
---

Update README.md
35 changes: 34 additions & 1 deletion packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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).
Loading