![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
chargebee
Advanced tools
This is the node.js Library for integrating with Chargebee. Sign up for a Chargebee account here.
Chargebee now supports two API versions - V1 and V2, of which V2 is the latest release and all future developments will happen in V2. This library is for API version V2. If you’re looking for V1, head to chargebee-v1 branch.
An attribute, api_version, is added to the Event resource, which indicates the API version based on which the event content is structured. In your webhook servers, ensure this api_version is the same as the API version used by your webhook server's client library.
Install the latest version 2.x.x of the library with the following commands:
$ npm install chargebee@">=2 <3"
Then require the library as:
var chargebee = require('chargebee');
Idempotency keys are passed along with request headers to allow a safe retry of POST requests.
var chargebee = require("chargebee");
chargebee.configure({site : "{site}", api_key : "{site_api_key}"})
chargebee.customer.create({
first_name : "John",
last_name : "Doe",
email : "john@test.com"
})
.setIdempotencyKey("<<UUID>>") // Replace <<UUID>> with a unique string
.request(function(error,result, headers) {
if(error){
//handle error
console.log(error);
}else{
console.log(result);
console.log(headers); // Retrieves response headers
console.log(isIdempotencyReplayed); // Retrieves idempotency replayed header value
var customer = result.customer;
var card = result.card;
}
});
isIdempotencyReplayed()
method can be accessed to differentiate between original and replayed requests.
The full documentation can be found on the chargebee site here:
https://apidocs.chargebee.com/docs/api?lang=node
See the LICENSE file.
FAQs
A library for integrating with Chargebee.
We found that chargebee demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.