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

billerapi

v0.1.0

Published

Official BillerAPI Node.js server SDK — connect users to their billers, retrieve bills, and automate billing workflows.

Readme

billerapi

The official BillerAPI Node.js server SDK. Connect your users to their billers, retrieve bills, and automate billing workflows — with typed responses, automatic retries, idempotency, cursor pagination, and webhook verification built in.

Early access (0.x). The client core, webhook verification, and resources — billers, bills, links, accountLinks, webhookEndpoints, feedback, pay — are implemented. Response shapes are being finalized against the live API before 1.0; pin a version for production.

Install

npm install billerapi

Requires Node.js ≥ 18 (uses the built-in fetch and crypto — no dependencies).

Quickstart

import { BillerApi } from 'billerapi';

const billerapi = new BillerApi(process.env.BILLERAPI_API_KEY!);

// List billers — auto-paginates across every page
for await (const biller of billerapi.billers.list({ search_term: 'electric' })) {
  console.log(biller.id, biller.name);
}

Works from CommonJS too:

const { BillerApi } = require('billerapi');

Resources

| Accessor | Key methods | |---|---| | billerapi.billers | list, retrieve | | billerapi.links | createToken, exchangeToken, retrieve | | billerapi.bills | list, retrieve, getStatement, triggerSync | | billerapi.accountLinks | syncBills, refresh, getRefreshStatus | | billerapi.webhookEndpoints | create, list, retrieve, update, del, rotateSecret | | billerapi.feedback | submit | | billerapi.pay | createToken, storePaymentMethod, listPaymentMethods, deletePaymentMethod, initiatePayment, retrievePayment | | billerapi.webhooks | constructEvent |

Authentication & environments

Pass your secret key. The environment is inferred from the key prefix, so you don't configure a base URL:

  • bak_test_… → sandbox (https://sandbox.api.billerapi.com)
  • bak_live_… → production (https://api.billerapi.com)
const billerapi = new BillerApi('bak_test_…', {
  maxRetries: 3,   // transient failures (429 / 5xx / network). Default 2.
  timeout: 30_000, // ms. Default 30s.
});
billerapi.mode; // 'sandbox' | 'live'

Pagination

list() returns the first page in .data and is async-iterable to walk every page without managing cursors:

const page = await billerapi.bills.list({ account_link_id });
page.data;        // first page
page.hasMore;     // is there another page?

for await (const biller of billerapi.billers.list()) {
  // …every biller across all pages
}

const all = await billerapi.billers.list().then((p) => p.toArray());

Errors

Every failure throws a typed error carrying the API's coded envelope. Branch by class or by .code; .requestId is always available for support:

import { RateLimitError, InvalidRequestError, BillerApiError } from 'billerapi';

try {
  await billerapi.billers.retrieve('biller_missing');
} catch (err) {
  if (err instanceof RateLimitError) {
    await sleep((err.retryAfter ?? 1) * 1000);
  } else if (err instanceof InvalidRequestError) {
    console.error(err.fieldErrors); // [{ param, code, message }]
  } else if (err instanceof BillerApiError) {
    console.error(err.code, err.requestId, err.docsUrl);
  }
}

Error classes: AuthenticationError, PermissionError, InvalidRequestError, RateLimitError, UpstreamError, ApiError, ConnectionError — all extend BillerApiError.

Idempotency

Mutating requests (POST) are automatically sent with an Idempotency-Key so a transparent retry never double-creates. Every resource method takes a RequestOptions second argument — pass your own idempotencyKey there to make a retry idempotent across process restarts:

await billerapi.links.createToken(params, { idempotencyKey: 'order_42' });

Verifying webhooks

Verify the BillerAPI-Signature header against your endpoint's signing secret. Always pass the raw request body:

import { BillerApi } from 'billerapi';

app.post('/webhooks', express.raw({ type: 'application/json' }), (req, res) => {
  try {
    const event = billerapi.webhooks.constructEvent(
      req.body,                          // raw Buffer/string
      req.headers['billerapi-signature'],
      process.env.BILLERAPI_WEBHOOK_SECRET!,
    );
    // handle event.type …
    res.sendStatus(200);
  } catch {
    res.sendStatus(400); // signature invalid or replayed
  }
});

License

MIT