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

@chemicalluck/recharge-api-node

v1.2.0

Published

ReCharge API Node.js Client

Readme

Recharge API Client for Node.js

A Node.js client for the Recharge Payments API covering both the 2021-01 and 2021-11 API versions.

npm package NPM Version Release & Publish License

Installation

npm install @chemicalLuck/recharge-api-node

Usage

import { Recharge } from "@ChemicalLuck/recharge-api-node";

const recharge = new Recharge("your-api-key");

// v1 (2021-01) API
const addresses = await recharge.v1.address.list(customerId);
const customer = await recharge.v1.customer.get(customerId);

// v2 (2021-11) API
const subscriptions = await recharge.v2.subscription.list();
const paymentMethods = await recharge.v2.paymentMethod.list();

Error handling

Non-2xx responses throw an HTTPResponseError that exposes the status code and the parsed error body returned by Recharge:

import { Recharge, HTTPResponseError } from "@ChemicalLuck/recharge-api-node";

try {
  await recharge.v2.customer.get(123);
} catch (error) {
  if (error instanceof HTTPResponseError) {
    console.error(error.status); // e.g. 422
    console.error(error.body); // parsed JSON error payload from Recharge
  }
}

Requests are automatically retried (up to 3 times) on 429 and 5xx responses, honouring the Retry-After header when present. list methods transparently follow pagination (Link headers for 2021-01, cursors for 2021-11) and return the full result set.

Resources

v1 (2021-01)

| Resource | Methods | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | address | create, get, update, delete, list, count, validate, applyDiscount | | asyncBatch | create, get, list, process, createTask, listTasks | | charge | get, list, count, change_next_charge_date, skip, unskip, refund, process, capture, apply_discount, remove_discount | | checkout | create, get, update, get_shipping_rates, process | | customer | create, get, update, delete, list, count, payment_sources | | discount | create, get, update, delete, list, count, applyToAddress, applyToCharge, remove | | metafield | create, get, update, delete, list, count | | notification | send | | onetime | create, get, update, delete, list | | order | get, update, delete, list, count, change_date, change_variant, clone, delay | | product | create, get, update, delete, list, count | | shop | get, shipping_countries | | subscription | create, get, update, delete, list, count, changeNextChargeDate, changeAddress, cancel, activate, bulkCreate, bulkUpdate, bulkDelete | | token | token_information | | webhook | create, get, update, delete, list, test |

v2 (2021-11)

| Resource | Methods | | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | account | get, list | | address | create, get, update, delete, list, merge, skipFutureCharge | | asyncBatch | create, get, list, process, createTask, listTasks | | bundleSelection | create, get, update, delete, list | | charge | get, list, applyDiscount, removeDiscount, skip, unskip, refund, process, capture, addFreeGift, removeFreeGift | | checkout | create, get, update, getShippingRates, process | | collection | create, get, update, delete, list, listProducts, addProducts, removeProducts | | credit | create, get, update, list, createAdjustment, listAdjustments, listAllAdjustments | | customer | create, get, update, delete, list, deliverySchedule, creditSummary | | discount | create, get, update, delete, list | | entitlement | create, update, delete, list | | event | list | | metafield | create, get, update, delete, list | | notification | sendEmail | | onetime | create, get, update, delete, list | | order | get, update, delete, list, clone, delay | | paymentMethod | create, get, update, delete, list | | plan | create, update, delete, list, bulkCreate, bulkUpdate, bulkDelete | | product | create, get, update, delete, list | | store | get | | subscription | create, get, update, delete, list, setNextChargeDate, changeAddress, cancel, activate, gift | | token | get | | webhook | create, get, update, delete, list, test |

Recharge Documentation

License

MIT