Official JavaScript/TypeScript SDK for ShegerPay — Ethiopian payment verification
# ShegerPay TypeScript SDK
Official TypeScript SDK for ShegerPay Payment Verification Gateway.
## Installation
```bash
npm install @shegerpay/sdk
# or
yarn add @shegerpay/sdk
```
## Quick Start
```typescript
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
```typescript
// 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
```typescript
// Create payment link
const link = await client.createPaymentLink({
title: "Order #123",
amount: 500,
currency: "ETB",
});
console.log(link.url); //
pay.shegerpay.com
console.log(link.qrCode); // data:image/png;base64,...
// List links
const links = await client.listPaymentLinks();
```
### Promo Codes
```typescript
const code = await cli …