npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@verse-bot/miniapp

v0.2.1

Published

Telegram Mini App integration utilities — framework-agnostic core with Angular support

Readme

@verse-bot/miniapp

Telegram Mini App integration utilities. Framework-agnostic core with an optional Angular integration layer built with Angular Package Format (APF).

Installation

npm install @verse-bot/miniapp

Angular peer dependencies are optional — install them only if you use the /angular entry:

npm install @angular/core @angular/common @angular/router rxjs

Usage

Framework-agnostic (plain TypeScript)

import { telegramApi } from '@verse-bot/miniapp';

// Initialize — returns true if running inside Telegram Mini App
const isMiniApp = await telegramApi.init({
  onBack: () => window.history.back(),
  onSettings: () => router.push('/settings'),
});

// Main button
telegramApi.showMainButton('Submit');
telegramApi.hideMainButton();

const off = telegramApi.onMainButtonClick(() => {
  handleSubmit();
});

// Secondary button (closes the Mini App by default)
telegramApi.showSecondaryButton('Cancel');
telegramApi.hideSecondaryButton();

// Back button
telegramApi.showBackButton();
telegramApi.hideBackButton();

// Settings button
telegramApi.showSettingsButton();
telegramApi.hideSettingsButton();

// Check if running inside Telegram
if (telegramApi.isMiniApp) {
  // Telegram-specific logic
}

// Cleanup
telegramApi.destroy();

Angular

import { TelegramApiService } from '@verse-bot/miniapp/angular';

@Component({
  selector: 'app-root',
  templateUrl: './app.html',
})
export class AppComponent implements OnInit, OnDestroy {
  readonly tg = inject(TelegramApiService);

  async ngOnInit() {
    await this.tg.init();
    // tg.isMiniApp$ — BehaviorSubject<boolean>
    // tg.api — direct access to the TelegramApi instance
  }

  ngOnDestroy() {
    this.tg.destroy();
  }
}

The Angular service automatically wires onBack to Location.back() and onSettings to router.navigateByUrl('/settings').

Access the underlying API via tg.api:

this.tg.api.showMainButton('Confirm');

const off = this.tg.api.onMainButtonClick(() => this.submit());
// call off() to unsubscribe

API

TelegramApi

| Method | Description | | --------------------------- | ---------------------------------------------------------------------------------------- | | init(options?) | Initialize the Mini App. Returns Promise<boolean>true if running inside Telegram. | | destroy() | Remove all listeners and unmount components. | | showMainButton(text) | Show the main bottom button with the given label. | | hideMainButton() | Hide the main button. | | onMainButtonClick(cb) | Subscribe to main button clicks. Returns an unsubscribe function. | | showSecondaryButton(text) | Show the secondary button (closes the app by default). | | hideSecondaryButton() | Hide the secondary button. | | showBackButton() | Show the native back button. | | hideBackButton() | Hide the native back button. | | showSettingsButton() | Show the settings gear button. | | hideSettingsButton() | Hide the settings button. | | isMiniApp | boolean — whether the app is running inside Telegram. |

TelegramApiOptions

interface TelegramApiOptions {
  onBack?: () => void; // called when the back button is tapped
  onSettings?: () => void; // called when the settings button is tapped
}

TelegramApiService (Angular)

| Member | Description | | ------------ | ---------------------------------------------------------------- | | init() | Initialize — wires back/settings to Angular Router and Location. | | destroy() | Cleanup. | | isMiniApp$ | BehaviorSubject<boolean> | | api | The underlying TelegramApi instance. |

Compatibility

| Dependency | Version | | -------------------- | --------------------- | | @telegram-apps/sdk | ^3.x | | @angular/core | >=14 <22 (optional) | | rxjs | >=7 <8 (optional) | | Node.js | >=18 |

License

Apache-2.0