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

paybetasdk

v1.4.1

Published

TypeScript SDK for Paybeta API

Readme

Paybeta SDK

A robust TypeScript SDK for integrating with the Paybeta API. This package supports both TypeScript and JavaScript applications.

Features

  • Airtime: Purchase airtime from all major providers.
  • Data Bundles: Browse and purchase data bundles.
  • Cable TV: Subscribe to DStv, GOtv, Startimes, etc.
  • Electricity: Pay bills for prepaid and postpaid meters.
  • Gaming: Fund betting accounts.
  • Wallet: Check wallet balance.
  • Showmax: Purchase Showmax vouchers.
  • Transactions: Query transaction status.

Installation

npm install paybetasdk

Usage

1. Initialization

Initialize the client with your Paybeta API Key.

import { Paybeta, PaybetaError } from "paybetasdk";

const paybeta = new Paybeta("YOUR_API_KEY");
// Optional: const paybeta = new Paybeta("YOUR_API_KEY", "CUSTOM_BASE_URL");

2. Airtime Service

Access via: paybeta.airtime

  • Get Providers returns a list of available airtime providers.

    const providers = await paybeta.airtime.getProviders();
  • Purchase Airtime

    const purchase = await paybeta.airtime.purchase({
      service: "mtn_vtu", // mtn_vtu, airtel_vtu, glo_vtu, 9mobile_vtu
      phoneNumber: "08012345678",
      amount: 100,
      reference: "REF_12345",
    });

3. Data Service

Access via: paybeta.data

  • Get Providers

    const providers = await paybeta.data.getProviders();
  • Get Bundles Retrieves available plans for a specific network.

    const bundles = await paybeta.data.getBundles("mtn_data");
    // returns array of { code, price, name }
  • Purchase Data

    const data = await paybeta.data.purchase({
      service: "mtn_data",
      phoneNumber: "08012345678",
      amount: 1000,
      code: "DATA_100MB", // Use 'code' from getBundles()
      reference: "REF_67890",
    });

4. Cable TV Service

Access via: paybeta.cable

  • Get Providers List available cable providers (DStv, GOtv, etc).

    const providers = await paybeta.cable.getProviders();
  • Get Bouquets List packages for a provider.

    const bouquets = await paybeta.cable.getBouquets("dstv");
    // returns { code, name, price }
  • Validate Account Check if a Smartcard number is valid.

    const val = await paybeta.cable.validateAccount({
      service: "dstv",
      customerId: "1234567890",
    });
    // val.data.name contains the customer name
  • Purchase Subscription

    const sub = await paybeta.cable.purchase({
      service: "dstv",
      smartCardNumber: "1234567890",
      amount: 5000,
      packageCode: "dstv-padi",
      customerName: "John Doe",
      reference: "REF_ABCDE",
    });

5. Electricity Service

Access via: paybeta.electricity

  • Get Providers List DISCOs (Ikeja, Eko, Abuja, etc).

    const discos = await paybeta.electricity.getProviders();
  • Validate Meter

    const meter = await paybeta.electricity.validateAccount({
      service: "ikeja-electric",
      customerId: "1111111111",
      type: "prepaid", // 'prepaid' or 'postpaid'
    });
    // meter.data.name and meter.data.address
  • Purchase Token / Bill Payment

    const power = await paybeta.electricity.purchase({
      service: "ikeja-electric",
      meterNumber: "1111111111",
      meterType: "prepaid",
      amount: 2000,
      customerName: "John Doe",
      customerAddress: "123 Street Name",
      reference: "REF_POWER_1",
    });

6. Gaming Service

Access via: paybeta.gaming

  • Get Providers List available gaming providers.

    const providers = await paybeta.gaming.getProviders();
  • Validate Account Validate a betting account ID.

    const account = await paybeta.gaming.validateAccount({
      service: "bet9ja",
      customerId: "123456789",
    });
    // account.data.name contains the customer name
  • Purchase Fund a betting account.

    const fund = await paybeta.gaming.purchase({
      service: "bet9ja",
      customerId: "123456789",
      amount: 1000,
      customerName: "John Doe",
      reference: "REF_GAME_1",
    });

7. Wallet Service

Access via: paybeta.wallet

  • Get Balance Check your current wallet balance.

    const balance = await paybeta.wallet.getBalance();
    // returns { balance, currency, ... }

8. Showmax Service

Access via: paybeta.showmax

  • Get Bouquets

    const plans = await paybeta.showmax.getBouquets();
  • Purchase Subscription

    const purchase = await paybeta.showmax.purchase();

9. Transaction Service

Access via: paybeta.transaction

  • Query Status Check the status of any transaction via reference.
    const status = await paybeta.transaction.query("REF_12345");

10. Error Handling

All methods throw a PaybetaError on failure.

try {
  await paybeta.airtime.purchase({ ... });
} catch (error) {
  if (error instanceof PaybetaError) {
    console.error(`Status: ${error.status}, Message: ${error.message}`);
    console.log(error.data); // API response payload
  }
}

License

ISC