パッケージの詳細

@telegram-apps/bridge

Telegram-Mini-Apps124.4kMIT2.10.3

TypeScript package to provide communication layer between Mini App and Telegram application.

telegram-mini-apps, typescript, bridge

readme

@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();
});

更新履歴

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.4.0 (2022-11-10)

Features

  • packages: add new package theme-params (818eb41)

0.3.3 (2022-11-09)

Note: Version bump only for package root

0.3.2 (2022-11-09)

Note: Version bump only for package root

0.3.1 (2022-11-09)

Note: Version bump only for package root

0.3.0 (2022-11-09)

Features

  • init: start listening to window resize event. Fix parser for viewport_changed event (6b84f01)

0.2.0 (2022-11-09)

Features

  • init: start listening to window resize event. Fix parser for viewport_changed event (6b84f01)

0.1.2 (2022-11-09)

Note: Version bump only for package sdk