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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yabetoo/sdk-js

v0.1.2

Published

Official Yabetoo SDK for JavaScript/TypeScript

Readme

Yabetoo JavaScript/TypeScript SDK

Official JavaScript/TypeScript SDK for the Yabetoo Payment Platform.

Installation

npm install @yabetoo/sdk-js
# or
yarn add @yabetoo/sdk-js
# or
pnpm add @yabetoo/sdk-js

Quick Start

import Yabetoo from '@yabetoo/sdk-js';

// Initialize with your secret key
const yabetoo = new Yabetoo('sk_test_your_secret_key');

// Create a payment intent
const intent = await yabetoo.payments.create({
  amount: 5000,
  currency: 'XAF',
  description: 'Order #123',
});

// Confirm with mobile money
const result = await yabetoo.payments.confirm(intent.id, {
  clientSecret: intent.clientSecret,
  paymentMethodData: {
    type: 'momo',
    momo: {
      msisdn: '242064000000',
      country: 'cg',
      operatorName: 'mtn',
    },
  },
  firstName: 'John',
  lastName: 'Doe',
});

console.log('Payment status:', result.status);

Features

  • Payments - Create, confirm, retrieve, and list payment intents
  • Checkout Sessions - Create hosted checkout pages for e-commerce
  • Disbursements - Send money to recipients via mobile money
  • Remittances - International money transfers

API Reference

Initialization

import Yabetoo from '@yabetoo/sdk-js';

// Sandbox environment
const yabetoo = new Yabetoo('sk_test_xxx');

// Production environment
const yabetoo = new Yabetoo('sk_live_xxx');

// With custom options
const yabetoo = new Yabetoo('sk_test_xxx', {
  options: {
    timeout: 60000, // Request timeout (ms)
    maxRetries: 5, // Max retry attempts
    retryDelay: 1000, // Initial retry delay (ms)
    customHeaders: {
      // Additional headers
      'X-Custom-Header': 'value',
    },
  },
});

Payments

// Create a payment intent
const intent = await yabetoo.payments.create({
  amount: 5000,
  currency: 'XAF',
  description: 'Order #123',
  metadata: { orderId: '123' },
});

// Confirm the payment
const result = await yabetoo.payments.confirm(intent.id, {
  clientSecret: intent.clientSecret,
  paymentMethodData: {
    type: 'momo',
    momo: {
      msisdn: '242064000000',
      country: 'cg',
      operatorName: 'mtn', // or 'airtel'
    },
  },
  firstName: 'John',
  lastName: 'Doe',
  receiptEmail: '[email protected]',
});

// Retrieve a payment
const payment = await yabetoo.payments.retrieve('pi_xxx');

// List all payments
const payments = await yabetoo.payments.all({
  page: 1,
  perPage: 20,
  sorting: [{ id: 'createdAt', desc: true }],
});

Checkout Sessions

const session = await yabetoo.sessions.create({
  accountId: 'acc_xxx',
  total: 15000,
  currency: 'XAF',
  successUrl: 'https://yoursite.com/success',
  cancelUrl: 'https://yoursite.com/cancel',
  metadata: { orderId: '123' },
  items: [
    {
      productId: 'prod_xxx',
      productName: 'T-Shirt',
      price: 5000,
      quantity: 3,
    },
  ],
});

// Redirect customer to checkout
window.location.href = session.url;

Disbursements

// Send money to a recipient
const disbursement = await yabetoo.disbursements.create({
  amount: 10000,
  currency: 'XAF',
  firstName: 'Marie',
  lastName: 'Dupont',
  paymentMethodData: {
    type: 'momo',
    momo: {
      msisdn: '242065000000',
      country: 'cg',
      operatorName: 'airtel',
    },
  },
});

// Check status
const status = await yabetoo.disbursements.retrieve(disbursement.id);

Remittances

// Create a remittance
const remittance = await yabetoo.remittances.create({
  amount: 50000,
  currency: 'XAF',
  firstName: 'Pierre',
  lastName: 'Martin',
  paymentMethodData: {
    type: 'momo',
    momo: {
      msisdn: '242066000000',
      country: 'cg',
      operatorName: 'mtn',
    },
  },
  metadata: { reference: 'REM-001' },
});

// Get remittance details
const details = await yabetoo.remittances.retrieve(remittance.id);

Error Handling

import Yabetoo, {
  YabetooError,
  ValidationError,
  AuthenticationError,
  NetworkError,
  RateLimitError,
} from 'yabetoo';

try {
  await yabetoo.payments.create({ amount: 5000, currency: 'XAF' });
} catch (error) {
  if (error instanceof ValidationError) {
    console.error('Validation failed:', error.errors);
  } else if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof RateLimitError) {
    console.error('Rate limited, retry after:', error.retryAfter);
  } else if (error instanceof NetworkError) {
    console.error('Network error:', error.message);
  } else if (error instanceof YabetooError) {
    console.error('API error:', error.code, error.message);
  }
}

Supported Payment Methods

| Operator | Country | Code | | ---------------- | ------- | ---- | | MTN Mobile Money | Congo | cg | | Airtel Money | Congo | cg |

TypeScript Support

This SDK is written in TypeScript and includes full type definitions. All models and interfaces are exported for use in your TypeScript projects.

import type {
  PaymentIntent,
  CreateIntentRequest,
  CheckoutSession,
  Disbursement,
  Remittance,
  MomoData,
  PaymentMethodData,
} from '@yabetoo/sdk-js';

Requirements

  • Node.js >= 16.0.0
  • TypeScript >= 5.0.0 (for TypeScript users)

License

MIT

sdk-js