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

v-birr

v1.0.1

Published

Server-side JavaScript SDK for V-Birr receipt verification.

Downloads

106

Readme

V-Birr JavaScript SDK

A server-side JavaScript SDK for creating organization projects, registering payer accounts, and validating receipt transactions against account details.

Verification only: the SDK checks existing receipts. It does not initiate, submit, or authorize payments. Keep all V-Birr credentials on a trusted server; never use either client in browser code or a mobile app bundle.

Requirements

  • Node.js 18 or newer
  • A V-Birr API base URL
  • A V-Birr project secret stored in a server-side environment variable

Install

From this directory:

npm install

Create a project and register a payer

import { VBirrClient } from "v-birr";

const vbirr = new VBirrClient({
  baseUrl: process.env.VBIRR_API_BASE_URL,
  projectSecret: process.env.VBIRR_PROJECT_SECRET
});

const project = await vbirr.createProject({
  organization: "Example Trading PLC",
  name: "Monthly collections",
  accountType: "CBE",
  baseAccount: "0987652314"
});

await vbirr.addPayer({
  projectId: project.id,
  name: "Payer One",
  accountNumber: "0912792308"
});

Project creation saves the fixed receiving baseAccount in V-Birr's authenticated server workspace. addPayer registers a full sender account for that project. These are SDK operations and do not require the frontend.

Generic transaction verification

For a one-off or generic integration, supply both account numbers and exactly one receipt URL, reference, or transaction number. transactionNumber is an alias for reference.

const result = await vbirr.verify({
  baseAccount: "0987652314",
  clientAccount: "0912792308",
  transactionNumber: "TX-001234"
});

if (result.success) {
  // Both receipt accounts matched.
  console.log(result.receipt, result.accountChecks, result.fetchedAt);
} else {
  // Do not treat mismatches, inconclusive results, or review states as verified.
  await queueForAdminReview({ result });
}

Project-bound transaction verification

After creating a project, validate a user's full account number and transaction number against the project's fixed receiving account and payer directory:

const result = await vbirr.verifyProject({
  projectId: project.id,
  clientAccount: "0912792308",
  transactionNumber: "TX-001234"
});

if (result.success) {
  // Receipt accounts match and the payer is registered to this project.
} else if (result.status === "needs_review") {
  // The sender is not registered; require manual review instead of auto-approval.
  await queueForAdminReview({ result });
}

The receiving account is loaded from the server-side project and cannot be replaced in a project-bound check. The result includes the receipt summary, account checks, decision, project registration status, fetch time, and the provider response returned by the authenticated V-Birr API. These fields may contain sensitive transaction information; store and log them accordingly.

Result shape

{
  success: true,
  status: "matched", // also "needs_review", "mismatch", "inconclusive", or "failed"
  receipt: { source: "cbe-pdf", amount: 50, currency: "ETB" },
  accountChecks: {
    sender: { status: "matched", field: "payerAccount" },
    recipient: { status: "matched", field: "receiverAccount" }
  },
  decision: { status: "matched", grant: true },
  project: null,
  fetchedAt: "2026-10-15T00:00:00Z",
  providerResponse: { /* receipt details returned by V-Birr */ },
  error: null
}

success is true only when V-Birr's decision explicitly grants validation. An unregistered project payer can return needs_review even if the receipt's account numbers match. Masked, missing, or unavailable account numbers are never treated as matches.

SDK methods and options

new VBirrClient({ baseUrl, projectSecret, fetchImpl, timeoutMs, idFactory })
  • baseUrl (required): V-Birr API deployment URL. HTTPS is required; HTTP is allowed only for localhost development.
  • projectSecret (required): server-side V-Birr project/admin secret.
  • fetchImpl (optional): Fetch-compatible function, useful for tests.
  • timeoutMs (optional): request timeout; defaults to 30 seconds.
  • idFactory (optional): project/payer ID factory; defaults to crypto.randomUUID.

Methods:

  • createProject({ organization, name, accountType, baseAccount, id, createdAt, signal })
  • addPayer({ projectId, name, accountNumber, id, createdAt, signal })
  • getWorkspace({ signal })
  • verify({ baseAccount, clientAccount, receiptUrl, reference, transactionNumber, idempotencyKey, signal })
  • verifyProject({ projectId, clientAccount, receiptUrl, reference, transactionNumber, idempotencyKey, signal })

The project and payer methods update the existing workspace using a read-modify-write request. Coordinate simultaneous workspace mutations across separate processes to avoid overwriting updates.

Direct verification and local screenshot OCR

The legacy VBirrVerificationClient is also exported for direct receipt checks and local screenshot OCR:

import { VBirrVerificationClient } from "v-birr";

const directClient = new VBirrVerificationClient({
  token: process.env.VBIRR_VERIFICATION_TOKEN
});

const result = await directClient.verify({
  sender: "0912792308",
  receiver: "0987652314",
  reference: "TX-001234"
});

verifyImage({ sender, receiver, imageBase64, idempotencyKey, signal }) reads a screenshot locally in memory. The screenshot is not uploaded or written to disk. The image must be no larger than 5 MB encoded; OCR must find one unique receipt URL/reference before verification proceeds. Ambiguous candidates are returned for manual selection; raw OCR text and image data are not returned.

Tests

npm test

License

MIT. See LICENSE.