@mini-apps/telegram-bridge
v1.0.0
Published
TypeScript package to provide the lowest level communication layer between a mini app and the Telegram client.
Maintainers
Readme
@mini-apps/telegram-bridge
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 @mini-apps/telegram-sdk.
Installation
pnpm i @mini-apps/telegram-bridge
# or
npm i @mini-apps/telegram-bridge
# or
yarn add @mini-apps/telegram-bridgeUsage
Here’s a basic example of how to use this package. For more details, refer to the package complete documentation.
import { on, postEvent } from '@mini-apps/telegram-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();
});