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

pesapal-hono

v1.0.7

Published

A lightweight Pesapal payment gateway integration using Hono.js

Readme

Pesapal API Client for Node.js

This is a Node.js client for interacting with the Pesapal API. It provides a convenient way to integrate Pesapal payment services into your Node.js applications.

Installation

npm install pesapal-hono

Usage

Initialization

First, you need to initialize the Pesapal client with your consumer key, consumer secret, and the API base URL.

import { Pesapal } from 'pesapal-hono';

const config = {
  consumerKey: 'YOUR_CONSUMER_KEY',
  consumerSecret: 'YOUR_CONSUMER_SECRET',
  apiBaseUrl: 'https://cybqa.pesapal.com/pesapalv3/api', // Use 'https://pay.pesapal.com/v3/api' for production
};

const pesapal = new Pesapal(config);

Authentication

The client handles authentication automatically. You can, however, explicitly get an authentication token if needed.

const token = await pesapal.getAuthToken();
console.log(token);

IPN (Instant Payment Notification)

Register an IPN URL

const response = await pesapal.registerIPN({
  url: 'YOUR_IPN_CALLBACK_URL',
  ipn_notification_type: 'POST', // or 'GET'
});
console.log(response);

Payments

Initiate a Payment

const response = await pesapal.submitOrder({
  id: 'ORDER_ID',
  currency: 'KES',
  amount: 100,
  description: 'Payment for goods',
  callback_url: 'YOUR_PAYMENT_CALLBACK_URL',
  notification_id: 'YOUR_IPN_ID',
  billing_address: {
    email_address: '[email protected]',
    phone_number: '123456789',
    first_name: 'John',
    last_name: 'Doe',
  },
});
console.log(response);

Transaction Status

Get Transaction Status

const response = await pesapal.getTransactionStatus('ORDER_TRACKING_ID');
console.log(response);

API Reference

The client exposes the following methods:

  • getAuthToken(): Returns a promise that resolves to the authentication token.
  • registerIPN(data): Registers an IPN URL.
  • submitOrder(data): Initiates a payment.
  • getTransactionStatus(orderTrackingId): Gets the status of a transaction.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.