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

ktruemoney_voucher

v1.0.0

Published

TrueMoney Wallet Voucher Redeemer bypassing Cloudflare using Playwright

Readme

ktruemoney_voucher

Bypass Cloudflare and redeem/verify TrueMoney Wallet gift vouchers with ease.

npm version npm downloads license

A powerful Playwright-based solution for automated TrueMoney Voucher management.


Installation

npm install ktruemoney_voucher
# or install globally for CLI access
npm install -g ktruemoney_voucher

Requires Node.js ≥ 14 and Playwright browser binaries.


Command Line Interface (CLI)

After installing globally, you can use the ktruemoney command:

# Redeem a voucher
ktruemoney redeem 08XXXXXXXX https://gift.truemoney.com/campaign/vouchers/XXXXX/redeem

# Verify voucher info
ktruemoney verify XXXXX

# Using a proxy
ktruemoney verify XXXXX --proxy http://myproxy.com:3128

Quick Start

1. Redeem a Voucher

The simplest way to redeem a voucher to your phone number.

import { redeem } from 'ktruemoney_voucher';

try {
  const result = await redeem('08XXXXXXXX', 'https://gift.truemoney.com/campaign/vouchers/YOUR_CODE/redeem');
  console.log('Success:', result.amount, 'THB');
} catch (error) {
  console.error(`Redeem Failed (${error.code}): ${error.message}`);
}

2. Verify Voucher (Info Only)

Fetch voucher details without redeeming it.

import { verify } from 'ktruemoney_voucher';

try {
  const info = await verify('YOUR_CODE');
  console.log('Voucher Owner:', info.owner_profile.full_name);
} catch (error) {
  console.error(`Verify Failed: ${error.message}`);
}

API Reference

Core Methods

| Method | Description | |---|---| | redeem(phone, voucher) | Validates and redeems a voucher to a mobile number | | verify(voucher) | Fetches voucher metadata (amount, owner, status) | | extractCode(data) | Staticaly extracts 35-char code from URLs or strings |

Advanced Usage (Custom Client)

import { VoucherClient } from 'ktruemoney_voucher';

const client = new VoucherClient({
  headless: false, // Show browser for debugging
  userAgent: 'Mozilla/5.0 ...',
  proxy: {
    server: 'http://myproxy.com:3128',
    username: 'user', // Optional
    password: 'pwd'  // Optional
  }
});

// Static Validation (No browser needed)
if (VoucherClient.isValidPhone('0812345678')) {
  const code = VoucherClient.extractCode(URL);
  const info = await client.verify(code);
}

Error Handling

All errors are instances of VoucherError.

| Code | Description | |---|---| | INVAILD_PHONE | The phone number format is incorrect | | INVAILD_VOUCHER | 35-character voucher code not found in input | | BROWSER_ERROR | Playwright or Chromium execution failure | | VOUCHER_OUT_OF_STOCK | The voucher has already been fully redeemed | | VOUCHER_EXPIRED | The voucher has reached its expiration date |


Features

  • Cloudflare Bypass — Uses Playwright to navigate protection layers automatically.
  • Simple API — Shorthand functions for common tasks like redeem and verify.
  • Robust Extraction — Automatically finds voucher codes in URLs or raw text.
  • Custom Errors — Catch specific issues with typed error codes.
  • Mobile Optimized — Uses mobile user agents for better compatibility.

License

MIT © Watcharapong Namsaeng