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

@dat-platform/advertiser

v1.0.12

Published

An SDK for advertisers to track user actions, such as Telegram channel or bot joins, and notify publishers upon completion.

Downloads

19

Readme

K2 Advertising SDK

K2 is a powerful advertising solution developed by DAT, designed to seamlessly integrate traditional programmatic advertising with Web3-based rewards. As a SaaS platform, K2 ensures efficient ad matching and delivery across diverse digital ecosystems.

Key Features

  • 🎯 Programmatic Ad Integration
  • 💎 Web3 Reward-Based Ad Formats
  • 🌐 Cross-Ecosystem Compatibility
  • 📊 Advanced Performance Analytics
  • 🔍 Automatic Telegram User ID Detection
  • 💰 Reward Balance Distribution
  • 🔍 Seamless Telegram WebApp Support

Installation

Install the SDK using either npm or yarn:

npm install @dat-platform/advertiser
# or
yarn add @dat-platform/advertiser

Getting Started

Note: When using the SDK within a Telegram Mini App, it automatically detects the user's Telegram ID. If using it outside Telegram or overriding detection, you may need to pass user_unique_id manually.

SDK Initialization

The SDK follows a singleton pattern to optimize resource usage:

import K2SDK from '@dat-platform/advertiser';

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

Using the SDK

Once initialized, you can access the SDK instance anywhere in your application:

// Retrieve SDK instance
const sdk = K2SDK.getInstance();

// Mark an action as complete
try {
  const response = await sdk.markActionComplete('YOUR_ADVERTISER_ID', 'TXN_ID');
  console.log('Response:', response);
} catch (error) {
  console.error('Failed to send rewards:', error);
}

React Integration Example

import React, { useEffect, useState } from 'react';
import K2SDK from '@dat-platform/advertiser';

const MyComponent = () => {
  const [taskCompleted, setTaskCompleted] = useState(false);
  const [result, setResult] = useState([]);

  useEffect(() => {
    if(taskCompleted === true ){
      onActionComplete();
    }
  }, [taskCompleted]);

  const onActionComplete = async () => {
    try {
        const sdk = K2SDK.getInstance();
        const response = await sdk.markActionComplete('YOUR_ADVERTISER_ID', 'TXN_ID');
        console.log('Response:', response);
        setResult(response)
      } catch (error) {
        console.error('Failed to send rewards:', error);
      }
  }

  return (
    // Your component JSX
  );
};

Error Handling

K2 SDK provides robust error handling for:

  • Initialization failures
  • API request errors
  • Invalid parameter inputs
  • Network issues

Always wrap SDK methods in try-catch blocks to manage potential errors effectively.

Support

For assistance or inquiries:

About DAT

DAT is a dynamic team from China and India, dedicated to innovating the intersection of programmatic advertising and Web3 technologies. K2 is our flagship ad-serving platform, empowering advertisers with next-generation ad delivery solutions.

License

This project is licensed under the MIT License. See the LICENSE file for more details.