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

thesieutoc-sdk

v1.0.1

Published

A high-performance TypeScript SDK for TheSieuToc API integration

Readme

TheSieuToc SDK 🚀

npm version License: MIT

A high-performance, type-safe TypeScript SDK for integrating with the TheSieuToc API (Vietnamese Card Payment Gateway).


✨ Features

  • 🚀 Type-Safe: Fully typed with TypeScript for a better developer experience.
  • 🛠 Easy Integration: Clean and intuitive API for card submission and status checking.
  • 💎 Premium Design: Built with modern software patterns.
  • 📦 Lightweight: Minimal dependencies.

📦 Installation

npm install thesieutoc-sdk

or

yarn add thesieutoc-sdk

🚀 Quick Start

1. Initialize the Client

import { TheSieuTocClient } from 'thesieutoc-sdk';

const client = new TheSieuTocClient('YOUR_API_KEY');

2. Submit a Card

const result = await client.submitCard({
  type: 'Viettel',
  mathe: '1234567890123',
  seri: '10001234567',
  menhgia: 50000,
  content: 'unique_order_id_123'
});

console.log(result.msg); // Thẻ đã gửi lên hệ thống chờ xử lý!

3. Check Card Status

const status = await client.checkCardStatus('unique_order_id_123');
console.log(status.msg); // Thẻ thành công

4. Fetch Discounts

const discounts = await client.getDiscounts();
const viettel = discounts.find(d => d.card_type === 'Viettel');
console.log(viettel?.discount['50000']);

5. Handle Callback (Webhook)

When TheSieuToc sends a callback to your server, you can use the SDK to validate the data structure:

import { TheSieuTocClient, CardCallbackData } from 'thesieutoc-sdk';

// In your Express route
app.post('/callback', (req, res) => {
  const data = req.body as CardCallbackData;

  if (TheSieuTocClient.isValidCallback(data)) {
    if (data.status === 'thanhcong') {
      console.log(`Card success: ${data.real_amount} VND`);
    } else {
      console.log(`Card failed: ${data.noidung}`);
    }
    res.send('OK');
  } else {
    res.status(400).send('Invalid data');
  }
});

📖 API Reference

TheSieuTocClient

constructor(apiKey: string)

Initializes the client with your secret API key.

submitCard(data: CardSubmissionRequest): Promise<CardSubmissionResponse>

Sends card information to the system for processing.

checkCardStatus(requestId: string): Promise<CheckStatusResponse>

Queries the current status of a card submission using the requestId.

getDiscounts(username?: string): Promise<DiscountInfo>

Fetches the latest card discount rates. Optional username for account-specific rates.


🎨 Constants & Types

The SDK exports all necessary types and constants to handle responses effectively.

import { ERROR_CODES, CHECK_STATUS_CODES } from 'thesieutoc-sdk';

console.log(ERROR_CODES['54']); // Chưa Nhập API key

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

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


Built with ❤️ by WangYi