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

@shegerpay/sdk

v2.2.1

Published

Official TypeScript/JavaScript SDK for the ShegerPay Payment Verification Gateway

Readme

ShegerPay TypeScript SDK

Official TypeScript SDK for ShegerPay Payment Verification Gateway.

Installation

npm install @shegerpay/sdk
# or
yarn add @shegerpay/sdk

Quick Start

import { ShegerPay } from "@shegerpay/sdk";

// Initialize client
const client = new ShegerPay("sk_test_xxx");

// Verify a payment
const result = await client.verify({
  transactionId: "FT24352648751234",
  amount: 100,
  provider: "cbe",
});

if (result.valid) {
  console.log("Payment verified!");
}

Features

  • ✅ Full TypeScript support with complete type definitions
  • ✅ Ethiopian banks (CBE, Telebirr, Awash, BoA, etc.)
  • ✅ Safe provider detection for BOA receipt URLs
  • ✅ Crypto payments (USDT, BTC, ETH)
  • ✅ Receipt image/PDF OCR via verifyImage
  • ✅ PayPal checkout, wallet balance, and payout requests
  • ✅ Payment links with QR codes
  • ✅ Reusable promo codes for payment links and custom API checkouts
  • ✅ Webhooks
  • ✅ Transaction history and monitoring

API Reference

Verification

// Verify with an explicit provider
const result = await client.verify({
  transactionId: "FT24352648751234",
  amount: 100,
  provider: "cbe",
});

// Quick verify
const result = await client.quickVerify("FT24352648751234", 100);

// BOA receipt verification
const boaResult = await client.verify({
  transactionId: "FT26091B1X5152078", // also accepts full slip URL, SMS text, or image via verifyImage
  amount: 100,
  provider: "boa",
  senderAccount: "52078",
});

// OCR receipt image/PDF verification
const imageResult = await client.verifyImage({
  screenshot: file,
  amount: 500,
});

Payment Links

// Create payment link
const link = await client.createPaymentLink({
  title: "Order #123",
  amount: 500,
  currency: "ETB",
});
console.log(link.url); // https://pay.shegerpay.com/abc123
console.log(link.qrCode); // data:image/png;base64,...

// List links
const links = await client.listPaymentLinks();

Promo Codes

const code = await client.createPromoCode({
  code: "STARTUP20",
  discountType: "percent",
  discountValue: 20,
  maxUses: 100,
  maxUsesPerCustomer: 1,
  minOrderAmount: 100,
});

const preview = await client.validatePromoCode({
  code: "STARTUP20",
  amount: 500,
  provider: "cbe",
  customerIdentifier: "[email protected]",
});

// Customer must pay preview.discounted_amount exactly.
const verified = await client.verify({
  transactionId: "FT26112GCXZD05529667",
  amount: preview.discounted_amount,
  provider: "cbe",
});

if (verified.verified) {
  await client.redeemPromoCode({
    code: "STARTUP20",
    amount: 500,
    provider: "cbe",
    transactionId: verified.transactionId || "FT26112GCXZD05529667",
    orderId: "order_1001",
    customerIdentifier: "[email protected]",
  });
}

Crypto Payments

// Get prices
const prices = await client.getCryptoPrices();
console.log(prices.BTC);

// Create crypto payment
const payment = await client.createCryptoPayment({
  amountUsd: 50,
  currency: "USDT",
  walletAddress: "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
});

// Verify crypto payment
const result = await client.verifyCryptoPayment(payment.referenceId);

PayPal

const order = await client.createPayPalOrder({
  amount: 25,
  currency: "USD",
  description: "Order #123",
});

await client.capturePayPalOrder(order.id);

const balance = await client.getPayPalWalletBalance();

await client.requestPayPalPayout({
  amount: 25,
  currency: "USD",
  recipientEmail: "[email protected]",
});

Webhooks

// Create webhook
const webhook = await client.createWebhook({
  url: "https://yoursite.com/webhook",
  events: ["payment.verified", "payment.failed"],
});
console.log(webhook.secret); // Save this!

// Verify signature (in your webhook handler)
import { verifyWebhookSignature } from "@shegerpay/sdk";

const isValid = await verifyWebhookSignature(
  rawBody,
  req.headers["x-shegerpay-signature"],
  webhookSecret
);

Monitoring

// Health check
const health = await client.getHealth();
console.log(health.status); // 'healthy'

// Provider status
const providers = await client.getProviderStatus();
console.log(providers.providersOnline); // '8/8'

Telegram Notifications

// Configure Telegram
await client.configureTelegram({
  botToken: "123456:ABC...",
  chatId: "-1001234567890",
});

// Test notification
await client.testTelegram();

// Disable
await client.disableTelegram();

Error Handling

import {
  ShegerPay,
  ShegerPayError,
  AuthenticationError,
  ValidationError,
} from "@shegerpay/sdk";

try {
  const result = await client.verify({ transactionId: "FT123", amount: 100, provider: "cbe" });
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.log("Invalid API key");
  } else if (error instanceof ValidationError) {
    console.log("Validation failed:", error.message);
  } else if (error instanceof ShegerPayError) {
    console.log("Error:", error.errorCode, error.message);
    console.log("Suggestion:", error.suggestion);
  }
}

Test Mode

// Test mode (sk_test_xxx) - simulates verification
const testClient = new ShegerPay("sk_test_xxx");
console.log(testClient.mode); // 'test'

// Live mode (sk_live_xxx) - real verification
const liveClient = new ShegerPay("sk_live_xxx");
console.log(liveClient.mode); // 'live'

License

MIT