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

@strongmb/node

v1.0.0

Published

Official Node.js SDK for the Strongmb API — Nigeria's #1 bill payment platform.

Readme

Strongmb Node.js SDK

Official Node.js SDK for the Strongmb API — Nigeria's #1 bill payment platform.

For the full API reference and endpoint details, visit developers.strongmb.ng.


Requirements

  • Node.js 18+

Installation

npm install @strongmb/node

Quick Start

const { Strongmb } = require('@strongmb/node');

const strongmb = new Strongmb('your-api-key');

const response = await strongmb.data.purchase({
    phone:       '08012345678',
    productCode: 'smb_mtn_sme_1gb_30days',
    reference:   'MYAPP' + Date.now(),
});

if (response.successful()) {
    console.log('Data sent! Reference:', response.data().reference);
} else if (response.processing()) {
    console.log('Processing — poll by reference to check status.');
} else if (response.failed()) {
    console.log('Transaction failed. Contact support if wallet was debited.');
}

Authentication

Get your API key from the Developer tab in your Strongmb dashboard.

// Live mode
const strongmb = new Strongmb('your-api-key');

// Sandbox / test mode
const strongmb = new Strongmb('your-api-key', { sandbox: true });

Data

// List all available data plans and product codes
const response = await strongmb.data.plans();
const billers  = response.data().billers;

// Purchase a data plan
const response = await strongmb.data.purchase({
    phone:       '08012345678',
    productCode: 'smb_mtn_sme_1gb_30days',
    reference:   'MYAPP_UNIQUE_REF_001',
});

Airtime

// List all airtime providers and product codes
const response = await strongmb.airtime.plans();

// Top up airtime
const response = await strongmb.airtime.purchase({
    phone:       '08012345678',
    productCode: 'smb_mtn_vtu',
    amount:      '100',
    reference:   'MYAPP_UNIQUE_REF_002',
});

Account

// Authenticated user profile
const response = await strongmb.account.user();

// Wallet balances
const response = await strongmb.account.wallets();

// Transaction history
const response = await strongmb.account.transactions();

// Single transaction by reference
const response = await strongmb.account.transaction('MYAPP_UNIQUE_REF_001');

Response

Every method returns a Response object:

response.ok()          // bool   — true when the API status is successful
response.message()     // string — human-readable message from the API
response.data()        // object — the response payload
response.code()        // string — machine-readable code (e.g. TRANSACTION_SUCCESSFUL)
response.traceId()     // string — use this when contacting support
response.httpStatus()  // number — HTTP status code
response.toObject()    // object — full raw response

// Purchase transaction helpers
response.successful()  // true when code === TRANSACTION_SUCCESSFUL
response.processing()  // true when still being processed — poll by reference
response.failed()      // true when transaction failed — wallet may have been debited

Handling all purchase outcomes

if (response.successful()) {
    const data = response.data();
    console.log('Done! Reference:', data.reference);

} else if (response.processing()) {
    // Request accepted but not yet fulfilled.
    // Poll account.transaction(reference) until it resolves.
    console.log('Processing — reference:', response.data().reference);

} else if (response.failed()) {
    // Transaction was attempted but failed.
    // Provide the trace ID to support if the wallet was debited.
    console.log('Failed. Trace ID:', response.traceId());
}

Error Handling

const { Strongmb, ApiError, AuthError, StrongmbError } = require('@strongmb/node');

try {
    const response = await strongmb.data.purchase({ ... });

} catch (err) {
    if (err instanceof AuthError) {
        // HTTP 401 — invalid or missing API key
        console.error('Invalid API key.');

    } else if (err instanceof ApiError) {
        // HTTP 4xx / 5xx — the API returned an error
        console.error(err.message);          // Human-readable message
        console.error(err.getApiCode());     // e.g. ERR_INSUFFICIENT_BALANCE
        console.error(err.getHttpStatus());  // e.g. 402
        console.error(err.getTraceId());     // Send this to [email protected]

    } else if (err instanceof StrongmbError) {
        // Network error or unexpected failure
        console.error('Network error:', err.message);
    }
}

Exception hierarchy

StrongmbError     — base: network errors, unexpected failures
  └── ApiError    — HTTP 4xx/5xx returned by the API
        └── AuthError — HTTP 401: invalid or missing API key

Notes

  • Always use a unique reference per transaction — duplicate references will be rejected.
  • References must contain only a-zA-Z0-9 characters. No spaces, dashes, or special characters.
  • Call strongmb.data.plans() or strongmb.airtime.plans() to discover valid productCode values before purchasing.
  • All methods are async and return a Promise — use await or .then().

Links

License

MIT