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

@emmanuelapabiekun/budpay

v0.1.0

Published

A lightweight, type-safe SDK for BudPay API

Downloads

260

Readme

BudPay TypeScript SDK

npm version License: MIT

A lightweight, high-fidelity, and type-safe SDK for integrating BudPay into your TypeScript/JavaScript projects. Built with performance and security in mind.

🚀 Features

  • Standardized Responses: Every API call returns a consistent { success, status, message, data } object.
  • Type Safety: Comprehensive TypeScript definitions for all request and response payloads.
  • Enhanced Debugging: Integrated diagnostic logging with sensitive data masking (keys, cards).
  • Security: HMAC-SHA256 signature verification for the required endpoints.
  • Pending Features: Webhook signature verification and card encryption (⚠️ Work In Progress).
  • Zero Dependencies: Lightweight footprint (only zod for validation).
  • Dual Support: Works with both ESM and CommonJS.

📦 Installation

npm install @emmanuelapabiekun/budpay
# or
yarn add @emmanuelapabiekun/budpay
# or
pnpm add @emmanuelapabiekun/budpay
# or
bun add @emmanuelapabiekun/budpay

🛠️ Configuration

Initialize the SDK with your BudPay secret and public keys. You can find these in your BudPay Dashboard.

import { BudPay } from "@emmanuelapabiekun/budpay";

const budpay = new BudPay({
  secretKey: process.env.BUDPAY_SECRET_KEY,
  publicKey: process.env.BUDPAY_PUBLIC_KEY,
  debug: true, // Enable for detailed diagnostic logs
});

[!NOTE] If keys are not provided in the constructor, the SDK will automatically look for BUDPAY_SECRET_KEY and BUDPAY_PUBLIC_KEY environment variables.

📖 Usage Examples

Verify a Transaction

const response = await budpay.transactions.verify("TRANSACTION_REFERENCE");

if (response.success) {
  console.log("Payment Successful:", response.data);
} else {
  console.error("Verification Failed:", response.message);
}

Create a Payout

const result = await budpay.payouts.transfer({
  amount: "1000",
  account_number: "0123456789",
  bank_code: "058",
  currency: "NGN",
  reference: "unique_bill_ref_" + Date.now(),
  narration: "unique_bill_ref_" + Date.now(),
  bank_name: "Test Bank",
  meta_data: [
    {
      sender_name: "sender_name",
      sender_address: "sender_address",
    },
  ],
});

Bill Payment

const result = await budpay.bills.airtimeTopup({
  amount: "1000",
  reference: "unique_bill_ref_" + Date.now(),
  provider: "mtn",
  number: "08012345678",
});

Verify Webhook Signature (⚠️ Work In Progress)

The Webhook verification utility is currently under maintenance and has been temporarily deactivated in the SDK.

// BudPay.verifyWebhook(...) // Currently throws an error

🔍 Modules

The SDK provides organized access to the entire BudPay API suite:

| Module | Description | | ----------------- | -------------------------------------------------- | | transactions | Payment initialization, verification, and history. | | payouts | Bank transfers and wallet payouts. | | bills | Airtime, data, and utility payments. | | virtualAccounts | Dynamic and static bank account collection. | | customers | Customer profile management. | | wallet | Balance checks and internal transfers. | | settlements | Track payouts to your business bank account. | | invoices | Professional invoice generation. | | paymentLinks | Easy-to-share payment URLs. | | identity | Account name verification and ID checks. |

🛡️ Security & Privacy

This SDK takes security seriously:

  • Masking: When debug: true is enabled, sensitive fields like card numbers and API keys are automatically redacted in logs.
  • Encryption: Built-in AES-CBC encryption for handling sensitive card data (⚠️ Work In Progress).
  • Validation: All inputs are validated using zod before being sent to the server.

📄 Documentation

For detailed information on API parameters and behavior, please refer to the Official BudPay Documentation.


🤝 Contributing

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

📜 License

MIT © Emmanuel Apabiekun