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

@zahlo/node

v1.2.0

Published

Zahlo server SDK for Node.js and Bun: checkout sessions, payments, refunds, subscriptions and webhook verification

Readme

@zahlo/node

Server SDK for the Zahlo merchant API. Zero dependencies, Node.js ≥ 18 and Bun, ESM and CommonJS.

npm install @zahlo/node
import { Zahlo } from "@zahlo/node";

const zahlo = new Zahlo(process.env.ZAHLO_API_KEY!); // zk_test_… → sandbox, zk_live_… → live

const session = await zahlo.checkoutSessions.create({
  mode: "hosted",
  currency: "EUR",
  lineItems: [{ name: "T-shirt", unitAmountMinor: 2500, quantity: 1 }],
  successUrl: "https://shop.example/success?session={CHECKOUT_SESSION_ID}",
  cancelUrl: "https://shop.example/cart",
});
// Redirect the browser to session.url

Typed request bodies

Every create, update and cancel takes the body type from the API contract (CheckoutSessionCreateParams, RefundCreateParams, …, all exported), so a missing required field or a wrong enum value fails at compile time. The types are generated from the merchant API's OpenAPI document.

Lists

list() resolves to one page ({ data, hasMore }) and is also async-iterable over every item, fetching later pages as needed:

for await (const refund of zahlo.refunds.list({ limit: 100 })) {
  console.log(refund.id, refund.status);
}
const recent = await zahlo.payments.list().autoPagingToArray({ limit: 500 });

Webhooks

Verify against the raw request body. The result is typed by event.type:

const event = zahlo.webhooks.constructEvent(
  await request.text(),
  request.headers.get("zahlo-signature"),
  process.env.ZAHLO_WEBHOOK_SECRET!
);
if (event.type === "checkout.session.completed") {
  await fulfil(event.data.object.id); // a CheckoutSession
}

Retries and idempotency

Every POST, PATCH and DELETE sends an Idempotency-Key (a UUID unless you pass idempotencyKey). Requests are retried up to maxRetries (default 2) on network errors, timeouts, 409 request_in_progress, 429 and 5xx, always with the same key, honouring Retry-After. Other 4xx errors are never retried.

Errors

Failures throw ZahloError subclasses (ZahloInvalidRequestError, ZahloAuthenticationError, ZahloPermissionError, ZahloPaymentBlockedError, ZahloIdempotencyError, ZahloRateLimitError, ZahloProviderError, ZahloAPIError, ZahloConnectionError; constructEvent throws ZahloSignatureVerificationError) with type, code, param, requestId and statusCode.

Anything without a typed method is reachable with zahlo.request(method, path, { body, query, idempotencyKey }).

Full guide: https://docs.zahlo.eu/integrations/node