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

telegram-miniapp-sdk

v2.2.0

Published

SDK for Telegram Mini Apps with authentication and ad integration

Readme

Telegram Mini App SDK

A comprehensive SDK for building Telegram Mini Apps and Games with integrated advertising and offer wall capabilities.

Features

  • 🔐 Secure Authentication
  • 📱 Advertisement Integration
  • 💰 Offer Wall Implementation
  • 🎮 Game Integration Support
  • 🔄 Real-time Updates

Installation

npm install telegram-miniapp-sdk
# or
yarn add telegram-miniapp-sdk

Quick Start

Initialize the SDK

The SDK uses a singleton pattern, which means you only need to initialize it once in your application:

import TelegramMiniAppSDK from 'telegram-miniapp-sdk';

// Initialize the SDK
try {
  const sdk = await TelegramMiniAppSDK.initialize({
    apiKey: 'YOUR_API_KEY',
  });
  console.log('SDK initialized successfully');
} catch (error) {
  console.error('SDK initialization failed:', error);
}

Using the SDK

After initialization, you can access the SDK instance from anywhere in your application:

// Get the SDK instance
const sdk = TelegramMiniAppSDK.getInstance();

// Get Offer Wall
try {
  const offers = await sdk.getOfferWall('YOUR_PUBLISHER_ID', {
    user_unique_id: 'OPTIONAL_USER_ID',
    limit: 10 // Optional and  Default value is 3
  });
  console.log('Offers:', offers);
} catch (error) {
  console.error('Failed to fetch offers:', error);
}

// Get Display Ads
try {
  const ads = await sdk.getAd('YOUR_PUBLISHER_ID', {
    user_unique_id: 'OPTIONAL_USER_ID'
  });
  console.log('Ads:', ads);
} catch (error) {
  console.error('Failed to fetch ads:', error);
}

React Integration Example

import React, { useEffect, useState } from 'react';
import TelegramMiniAppSDK from 'telegram-miniapp-sdk';

// Initialize SDK at app startup
const initializeSDK = async () => {
  try {
    await TelegramMiniAppSDK.initialize({
      apiKey: process.env.REACT_APP_SDK_API_KEY
    });
    return true;
  } catch (error) {
    console.error('SDK initialization failed:', error);
    return false;
  }
};

// Use in components
const MyComponent = () => {
  const [offers, setOffers] = useState([]);

  useEffect(() => {
    const fetchOffers = async () => {
      try {
        const sdk = TelegramMiniAppSDK.getInstance();
        const offerWall = await sdk.getOfferWall("YOUR_PUBLISHER_ID");
        setOffers(offerWall);
      } catch (error) {
        console.error('Failed to fetch offers:', error);
      }
    };

    fetchOffers();
  }, []);

  return (
    // Your component JSX
  );
};

Error Handling

The SDK throws errors in the following cases:

  • When trying to use getInstance() before initialization
  • When initialization fails
  • When API requests fail
  • When invalid parameters are provided

Always wrap SDK calls in try-catch blocks for proper error handling.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For help, contact our support team.