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

@buildry-wire/checkout

v1.0.0

Published

Client-side drop-in for presenting a Wire hosted checkout session in the browser

Readme

@buildry-wire/checkout

Client-side drop-in for presenting a Wire hosted checkout session in the browser. Zero runtime dependencies. Safe to ship in client code — it never sees a secret key.

This is the browser companion to the server SDK. Your backend creates the checkout session (with your secret key) and hands the browser the hosted url; this library presents it and tells you the outcome.

Install

npm install @buildry-wire/checkout

How the flow works

  1. Server-side (your backend, with your secret key): create a checkout session. You get back a hosted url of the form https://pay.wire.mn/c/{token}.
  2. Browser: pass that url to this library.
  3. This library presents the hosted page (redirect or overlay/popup) and resolves the outcome by polling the session status API — the status API is the single source of truth for completion, never the redirect.

Quickstart — redirect mode

Full-page navigation to the hosted page. After payment the hosted page returns the buyer to your configured return URL, where you re-confirm the result server-side.

import { WireCheckout } from "@buildry-wire/checkout";

// `url` came from your backend after it created the session.
const checkout = new WireCheckout();
checkout.redirectToCheckout({ url });

Quickstart — overlay / popup mode

Present the hosted page in a centered popup (default) or a modal iframe overlay, and await the outcome:

import { WireCheckout } from "@buildry-wire/checkout";

const checkout = new WireCheckout();

const result = await checkout.open({ url });            // popup (default)
// or: await checkout.open({ url }, { presentation: "overlay" });

switch (result.status) {
  case "completed":
    console.log("paid", result.paymentStatus, result.redirectUrl);
    break;
  case "canceled":
    console.log("buyer canceled");
    break;
  case "failed":
    console.log("payment failed");
    break;
}

result is { status, paymentStatus, redirectUrl }. Resolution is always confirmed against the status API; closing the popup or returning from a redirect only triggers an immediate confirmation poll.

Configuration

new WireCheckout({
  baseURL: "https://pay.wire.mn", // origin for token-only targets
  pollIntervalMs: 2000,            // status poll cadence
  timeoutMs: 600_000,              // overall budget before open() rejects with a timeout
});

You can also pass an explicit token instead of a url:

await checkout.open({ token: "cs_test_…", baseURL: "https://pay.wire.mn" });

Test operator

In sandbox, sessions are created against the ["sandbox"] test operator. In live mode the buyer sees the operators enabled on your account.

Errors

import { WireCheckoutError } from "@buildry-wire/checkout";

try {
  await checkout.open({ url });
} catch (e) {
  if (e instanceof WireCheckoutError) console.log(e.code); // invalid_url, timeout, network_error, …
}

Security

This package is designed to run in untrusted client code. It only ever touches a public hosted url/token and the public status endpoint — never a secret key. Create sessions on your backend.

Docs

Full documentation: docs.wire.mn.

License

MIT