
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
telegram-sdk
Advanced tools
This repository offers an npm package for developing web applications for your Telegram bot. It re-exports the API provided by Telegram's JS module. The benefit of this package is that it includes TypeScript types, simplifying project setup.
pnpm add telegram-sdk
you don't need to install the Telegram JS module separately, as it is included in this package.
import 'telegram-sdk/core';
import { WebApp, WebView } from 'telegram-sdk';
// to display the initData
console.log(WebApp.initData);
// to show the main button
WebApp.MainButton.show();
// to set the app background color
WebApp.setBackgroundColor('#f60000')
// to set the app header color
WebApp.setHeaderColor('bg_color');
// Display a swipe vertical by event
WebView.postEvent('web_app_setup_swipe_behavior', false, {
allow_vertical_swipe: false,
});
// ready method must come last
WebApp.ready();
import { WebApp, WebView } from 'telegram-sdk';
// Config something...
WebApp.expand(); // Expand app
WebApp.disableClosingConfirmation();
WebApp.disableVerticalSwipes(); // Disable Vertical Swiper
// ready method must come last
WebApp.ready();
Refer to the official Telegram documentation for Web Apps to explore additional features available through WebApp.
Core script is available in the Telegram JS module
FAQs
Telegram Web App - (Uses July 7, 2024, Bot API 7.7)
The npm package telegram-sdk receives a total of 5 weekly downloads. As such, telegram-sdk popularity was classified as not popular.
We found that telegram-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.