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

@borapesa/clickpesa

v0.3.16

Published

ClickPesa provider adapter for Bora Pesa

Readme

@borapesa/clickpesa

ClickPesa provider adapter for Bora Pesa.

ClickPesa is a licensed Payment System Provider under the Bank of Tanzania, supporting mobile money (M-Pesa, Airtel Money, Tigo Pesa, HaloPesa), card payments (Visa, Mastercard), bank payouts (ACH/RTGS), BillPay control numbers, hosted checkout/payout links, and exchange rates.

Install

pnpm add @borapesa/pesa @borapesa/clickpesa

Quick Start

import { createPesa } from '@borapesa/pesa';
import { ClickPesaProvider } from '@borapesa/clickpesa';

const pesa = createPesa({
  provider: new ClickPesaProvider({
    sandbox:  true, // false for production
    clientId: process.env.CLICKPESA_CLIENT_ID!,
    apiKey:   process.env.CLICKPESA_API_KEY!,
  }),
});

// USSD push — sends PIN prompt to customer's phone
const order = await pesa.createOrder({
  amount:    15000,
  currency:  'TZS',
  reference: 'order_001',
  customer:  { name: 'Juma Ali', phone: '255712345678' },
});

// Poll status
const status = await pesa.getPaymentStatus(order.orderId);

Config

| Field | Type | Required | Description | |---|---|---|---| | clientId | string | ✅ | Client ID from ClickPesa dashboard | | apiKey | string | ✅ | API key from ClickPesa dashboard | | sandbox | boolean | ❌ | Target sandbox environment (api-sandbox.clickpesa.com) | | baseUrl | string | ❌ | Override base URL (takes precedence over sandbox) | | checksumKey | string | ❌ | HMAC-SHA256 secret for request signing + webhook verification | | redirectUrl | string | ❌ | Default redirect URL for hosted checkout. Overridable per-payment via payload.redirectUrl |

Auth

Token-based — client-id + api-key sent as custom headers to ClickPesa's /third-parties/generate-token endpoint. Tokens are cached in memory for 55 minutes (5-minute safety margin before the 1-hour expiry).

Supported Operations

| Operation | Supported | Notes | |---|---|---| | createOrder | ✅ | USSD push (default). Checkout link when redirectUrl is set. | | getPaymentStatus | ✅ | | | handleWebhook | ✅ | HMAC-SHA256 checksum verification via Web Crypto | | disburse | ✅ | Mobile money + bank payout (ACH/RTGS) | | validateCredentials | ✅ | Health check via token endpoint | | getBalance | ✅ | Wallet balances across currencies | | getAccountStatement | ✅ | Transaction history with date filters | | previewOrder | ✅ | Preview USSD push or card payment | | previewDisburse | ✅ | Preview mobile money or bank payout | | getNameLookup | ✅ | Resolve account holder via payout preview | | listOrders | ✅ | Paginated with date filtering | | getBanks | ✅ | List supported banks + BIC codes | | getExchangeRates | ✅ | Currency conversion rates | | generatePayoutLink | ✅ | Hosted payout link (recipient enters details) | | refund | ❌ | Not exposed by ClickPesa API | | cancelOrder | ❌ | Not exposed by ClickPesa API |

Webhooks

Set your webhook URL in the ClickPesa dashboard to https://your-app.com/api/pesa/webhook. Provide checksumKey in the config to enable HMAC-SHA256 verification and request signing.

Credentials

Get your clientId and apiKey from the ClickPesa Dashboard. Sign up at clickpesa.com.