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

vue-tg

v0.10.0

Published

Telegram integration for Vue

Readme

vue-tg - Telegram integration for Vue

docs version downloads

A lightweight package for seamless integration of Telegram Mini Apps and Telegram Widgets features.

Usage Example

<template>
  <MainButton text="Open alert" @click="() => popup.showAlert('Hello!')" />
</template>

<script lang="ts" setup>
import { MainButton } from 'vue-tg'
import { usePopup } from 'vue-tg/latest'

const popup = usePopup()
</script>

Installation

Install package:

npm i vue-tg

To connect your Mini App to the Telegram client, place the script telegram-web-app.js in the <head> tag before any other scripts, using this code:

<script src="https://telegram.org/js/telegram-web-app.js"></script>

Features

Type Safety

In addition to static typing, the library enforces runtime feature support checks to prevent errors on clients with outdated Bot API support.

const deviceStorage = useDeviceStorage()

// ❌ Type error:
// 'getItem' may not be available — DeviceStorage was introduced in Bot API 9.0
deviceStorage.getItem('token')

if (deviceStorage.isVersionAtLeast('9.0')) {
  // ✅ Safe to use
  deviceStorage.getItem('token')
}

You can opt out of these checks or define a minimum required Bot API version, which disables warnings for features introduced up to that version. For details, see the versioning section in the documentation.

Reactivity

You can react to changes using the standard Vue reactivity pattern:

const miniApp = useMiniApp()

watch(miniApp.isActive, (isActive) => {
  if (isActive)
    startUpdating()
  else
    stopUpdating()
})

The isActive field is reactive, so it can be used in watch, computed, or any other reactive context.

In the documentation, all reactive fields are marked with reactive tag.

Async Support

You can use async/await to work with methods — no need to nest callbacks.

const miniApp = useMiniApp()
const qrScanner = useQrScanner()
const popup = usePopup()

// Old callback-style flow
qrScanner.show({ text: 'Scan URL' }, (url) => {
  popup.showConfirm(`Open ${url}?`, (ok) => {
    if (ok) {
      miniApp.openLink(url)
    }
  })
})

// The modern way — flat and readable
const url = await qrScanner.show({ text: 'Scan URL' })
const ok = await popup.showConfirm(`Open ${url}?`)
if (ok) {
  miniApp.openLink(url)
}

Methods that support async execution are marked with async tag in the documentation. Callback-style usage is still available for compatibility.

Components

Available components:

Widgets

Documentation

Instructions

Mapping

| Field | Composable | | ---------------------------- | ------------------------------------------------------------------------------------------------------- | | initData | useMiniApp | | initDataUnsafe | useMiniApp | | version | useMiniApp | | platform | useMiniApp | | colorScheme | useTheme | | themeParams | useTheme | | isActive | useMiniApp | | isExpanded | useViewport | | viewportHeight | useViewport | | viewportStableHeight | useViewport | | headerColor | useTheme | | backgroundColor | useTheme | | isClosingConfirmationEnabled | useMiniApp | | isVerticalSwipesEnabled | useViewport | | isFullscreen | useViewport | | isOrientationLocked | useViewport | | safeAreaInset | useViewport | | contentSafeAreaInset | useViewport | | BackButton | useBackButton | | MainButton | useMainButton | | SecondaryButton | useSecondaryButton | | SettingsButton | useSettingsButton | | HapticFeedback | useHapticFeedback | | CloudStorage | useCloudStorage | | BiometricManager | useBiometricManager | | Accelerometer | useAccelerometer | | DeviceOrientation | useDeviceOrientation | | Gyroscope | useGyroscope | | LocationManager | useLocationManager | | DeviceStorage | useDeviceStorage | | SecureStorage | useSecureStorage | | isVersionAtLeast | useMiniApp | | setHeaderColor | useTheme | | setBackgroundColor | useTheme | | setBottomBarColor | useTheme | | enableClosingConfirmation | useMiniApp | | disableClosingConfirmation | useMiniApp | | enableVerticalSwipes | useViewport | | disableVerticalSwipes | useViewport | | requestFullscreen | useViewport | | exitFullscreen | useViewport | | lockOrientation | useViewport | | unlockOrientation | useViewport | | addToHomeScreen | useHomeScreen | | checkHomeScreenStatus | useHomeScreen | | onEvent | Event Handling | | offEvent | Managing Event Subscriptions | | sendData | useMiniApp | | switchInlineQuery | useMiniApp | | openLink | useMiniApp | | openTelegramLink | useMiniApp | | openInvoice | useMiniApp | | shareToStory | useMiniApp | | shareMessage | useMiniApp | | setEmojiStatus | useEmojiStatus | | requestEmojiStatusAccess | useEmojiStatus | | downloadFile | useMiniApp | | hideKeyboard | useMiniApp | | showPopup | usePopup | | showAlert | usePopup | | showConfirm | usePopup | | showScanQrPopup | useQrScanner | | closeScanQrPopup | useQrScanner | | readTextFromClipboard | useClipboard | | requestWriteAccess | useMiniApp | | requestContact | useMiniApp | | ready | useMiniApp | | expand | useViewport | | close | useMiniApp |