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

paychef

v1.0.0

Published

PayChef SDK for JavaScript/TypeScript - client library for the PayChef payment API

Readme

PayChef SDK for JavaScript / TypeScript

Official JavaScript/TypeScript client library for the PayChef payment API. Works in Node.js 18+, Bun, Deno, and any runtime with the Fetch API. Fully typed, zero dependencies.

Installation

npm install paychef

Quick Start

import { PayChef } from 'paychef';

const paychef = new PayChef({
  instance: 'your-instance-name', // e.g. 'demo' for https://demo.paychef.com
  apiSecret: 'your-api-secret',   // from your PayChef instance admin panel
});

// Create a payment gateway (checkout) and redirect your customer to `link`
const gateway = await paychef.gateway.create({
  amount: 1000, // in the smallest currency unit, e.g. 10.00 CHF
  currency: 'CHF',
  purpose: 'Order #1234',
  successRedirectUrl: 'https://shop.example.com/success',
  failedRedirectUrl: 'https://shop.example.com/failed',
  cancelRedirectUrl: 'https://shop.example.com/cancel',
});

console.log(gateway.link);

CommonJS is also supported:

const { PayChef } = require('paychef');

Verifying your credentials

await paychef.signatureCheck.retrieve(); // throws PayChefError if credentials are wrong

Common operations

// Check payment status after the customer returns
const gw = await paychef.gateway.retrieve(gateway.id);
console.log(gw.status); // 'waiting' | 'confirmed' | ...

// Transactions
const tx = await paychef.transaction.retrieve(123);
const txs = await paychef.transaction.list({ limit: 50 });
await paychef.transaction.refund(123, { amount: 500 }); // partial refund
await paychef.transaction.capture(123);                 // capture a reservation

// Subscriptions
const sub = await paychef.subscription.retrieve(1);
await paychef.subscription.cancel(1);

// Invoices, paylinks, designs, payouts, QR codes, ...
const invoice = await paychef.invoice.create({
  title: 'Invoice 2026-001',
  amount: 2500,
  currency: 'CHF',
  purpose: 'Consulting',
});
const methods = await paychef.paymentMethod.list();
const payouts = await paychef.payout.list();

Error handling

Every failed API call throws a PayChefError with statusCode, message, and an optional machine-readable reason:

import { PayChef, PayChefError } from 'paychef';

try {
  await paychef.gateway.create({ amount: 1000, currency: 'CHF' });
} catch (err) {
  if (err instanceof PayChefError) {
    console.error(err.statusCode, err.message, err.reason);
  }
}

Advanced configuration

const paychef = new PayChef({
  instance: 'your-instance',
  apiSecret: 'your-secret',
  version: '1.8',        // pin a specific API version (default: '1.15')
  timeout: 10_000,       // request timeout in ms (default: 20000)
});

API reference

| Resource | Methods | | --- | --- | | paychef.gateway | create, retrieve, delete | | paychef.transaction | retrieve, list, charge, refund, capture, receipt, preAuthorize, cancel | | paychef.subscription | create, retrieve, list, update, cancel | | paychef.invoice | create, retrieve, delete | | paychef.page | create, retrieve, list, delete | | paychef.design | create, retrieve, list, update, delete | | paychef.payout | retrieve, list, details | | paychef.paymentMethod | retrieve, list | | paychef.paymentProvider | list | | paychef.qrCode | create, retrieve, delete | | paychef.bill | create, retrieve, list, update, delete | | paychef.signatureCheck | retrieve | | paychef.authToken | create | | paychef.ecr | pair, unpair, payment, cancelPayment, voidPayment, getPayment, getPaymentMethods |

Amounts are always given in the smallest currency unit (e.g. Rappen/Cents).

License

MIT — see LICENSE.