![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
chargebee
Advanced tools
This is the node.js library for integrating with Chargebee. Sign up for a Chargebee account here.
Note If you’re using API V1, head to chargebee-v1 branch.
Node 0.6 or higher.
Install the latest version of the library with:
npm install chargebee
# or
yarn add chargebee
# or
pnpm install chargebee
The package needs to be configured with your site's API key, which is available under Configure Chargebee Section. Refer here for more details.
The full documentation can be found on the Chargebee API Docs: https://apidocs.chargebee.com/docs/api?lang=node
const chargebee = require('chargebee');
chargebee.configure({
site: '<YOUR_SITE_NAME>',
api_key: '<YOUR_API_KEY>',
});
Or using ES modules,
import chargebee from 'chargebee';
chargebee.configure({
site: '<YOUR_SITE_NAME>',
api_key: '<YOUR_API_KEY>',
});
try {
const result = await chargebee.customer
.create({
email: 'john@test.com',
// other params
})
.request();
// access customer as result.customer;
} catch (err) {
// handle error
}
chargebee.customer
.create({
email: 'john@test.com',
// other params
})
.request()
.then((result) => {
// handle result
// access customer as result.customer;
})
.catch((err) => {
// handle error
});
chargebee.customer
.create({
email: 'john@test.com',
// other params
})
.request(function (error, result) {
if (error) {
// handle error
} else {
// handle result
// access customer as result.customer;
}
});
You can import the types as shown below.
import chargebee, { Customer } from 'chargebee';
chargebee.configure({
site: '<YOUR_SITE_NAME>',
api_key: '<YOUR_API_KEY>',
});
const createCustomer = async () => {
const inputParams: Customer.CreateInputParam = {
email: 'john@test.com',
first_name: 'John',
last_name: 'Doe',
};
const { customer } = await chargebee.customer.create(inputParams).request();
console.log(customer);
};
createCustomer();
For pagination: offset
is the parameter that is being used. The value used for this parameter must be the value returned for next_offset
parameter in the previous API call.
const fetchCustomers = async (offset) => {
const result = await chargebee.customer.list({
limit: 2,
offset: offset,
first_name: { is: 'John' },
}).request();
return {
customers: result.list.map((obj) => obj.customer),
next_offset: result.next_offset,
};
};
const getCustomers = async () => {
const { customers, next_offset } = await fetchCustomers();
console.log('Offset:', next_offset); // Print the offset value
// Fetching next set of customers
await fetchCustomers(next_offset);
};
getCustomers().catch((err) => {
console.log(err);
});
const result = await chargebee.customer
.create({ email: 'john@test.com', cf_host_url: 'http://xyz.com' }) //Add custom field in payload
.headers({
'chargebee-event-email': 'all-disabled', // To disable webhooks
'chargebee-request-origin-ip': '192.168.1.2',
})
.setIdempotencyKey("safeKey")
.request();
const customer = result.customer;
console.log(customer.cf_host_url);
Idempotency keys are passed along with request headers to allow a safe retry of POST requests.
const result = await chargebee.customer
.create({ email: 'john@test.com' })
.setIdempotencyKey("safeKey")
.request();
const customer = result.customer;
const headers = result.headers;
const isIdempotencyReplayed = result.isIdempotencyReplayed;
OR
chargebee.customer.create({ email: 'john@test.com', cf_host_url: 'http://xyz.com' })
.setIdempotencyKey("safeKey")
.request(function(error,result) {
if(error){
//handle error
}else{
const customer = result.customer;
const headers = result.headers;
const isIdempotencyReplayed = result.isIdempotencyReplayed;
}
});
const newCust = await chargebee.customer.create({
email: 'john@test.com',
first_name: 'John',
last_name: 'Doe'
}).request({
site: '<YOUR_SITE_NAME>',
api_key: '<YOUR_API_KEY>',
});
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.
See the LICENSE file.
FAQs
A library for integrating with Chargebee.
The npm package chargebee receives a total of 0 weekly downloads. As such, chargebee popularity was classified as not popular.
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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.