@telegram-apps/bridge
TypeScript icon, indicating that this package has built-in type declarations

2.8.2 • Public • Published

@telegram-apps/bridge

NPM Size docs-badge code-badge

The lowest level communication layer with Telegram Mini Apps.

This package provides fundamental utilities and types for developing applications on the Telegram Mini Apps platform.

While a developer can use this package alone, it's recommended to use a higher-level package like @telegram-apps/sdk.

Installation

pnpm i @telegram-apps/bridge
# or
npm i @telegram-apps/bridge
# or
yarn add @telegram-apps/bridge

Usage

Here’s a basic example of how to use this package. For more details, refer to the package complete documentation.

import { on, postEvent } from '@telegram-apps/bridge';

// Show the back button, wait for it to be clicked once,
// then hide it.
postEvent('web_app_setup_back_button', { is_visible: true });

const off = on('back_button_pressed', () => {
  postEvent('web_app_setup_back_button', { is_visible: false });
  off();
});

Package Sidebar

Install

npm i @telegram-apps/bridge

Weekly Downloads

25,375

Version

2.8.2

License

MIT

Unpacked Size

575 kB

Total Files

44

Last publish

Collaborators

  • dimitreee
  • qbnk
  • sorawalker
  • mainsmirnov