← Back to list

Chargebee’s Node.js SDK Gets a (Long-Due) Makeover

tl;dr: Chargebee Node.js SDK has a new, unified update: Version 3. Rewritten from the ground up with cleaner APIs, robust TypeScript…

Sriram Thiagarajan in Engineering @ Chargebee · 2025-01-06 08:44 · 6 claps · 2.7 min read
#chargebee #nodejs #typescript #javascript
Open on Medium ↗
Wiki topics: 🌐 · Web Development

Chargebee’s Node.js SDK Gets a (Long-Due) Makeover

tl;dr: Chargebee Node.js SDK has a new, unified update: Version 3. Rewritten from the ground up with cleaner APIs, robust TypeScript support, and compatibility with latest JavaScript runtimes; whether you’re configuring the SDK, making API calls, or handling custom headers, v3 has everything you’ll need to code better.

The Chargebee Node.js SDK has been around for more than a decade. It nets 100K combined weekly downloads. But it just hasn’t kept pace with the fast-moving JavaScript ecosystem.

New JavaScript runtimes have appeared in recent years. All built around goals of delivering speed, well-optimized APIs, and a more complete DX. Goals that we’ve also made central for this new release.

Then serving two separate SDKs — one for Node.js, one for TypeScript — has only bred confusion. Especially as both those SDKs relied on some outdated dependencies, inconsistent TypeScript support, and verbose workflows.

So when we asked ourselves: What should a great SDK look like, today?

The answer couldn’t be a patch or a tweak.

It had to be a rewrite.

The big change: One unified SDK

This new version:

  • Supports both ESM and CJS module systems
  • Runs smoothly on Bun, Deno, Cloudflare Workers, and other modern runtimes
  • Leverages native features such as fetch and Promise

This also means that the chargebee-typescript package is getting deprecated. But anyone using it will have ample time (and support from us) to migrate to the new version.

Let’s look at just some of the quality-of-life improvements that v3 delivers.

What’s new?

Idiomatic, modern JavaScript

The new SDK just works. Here’s how:

  • Stronger TypeScript inference that reduces errors and guesswork
  • Function parameters now use camelCase instead of snake_case
  • Native async/await is supported for cleaner syntax
  • The ability to create multiple client instances for more complex use cases

Less boilerplate, more flow

This update significantly tackles verbosity, improving readability across the board. For example:

  • You no longer need to append .request() to every API call.
  • Efficient client setup — functions like .configure() and .updateTimeoutMillis() are now consolidated into simpler configuration parameters.

(Much) better typings

Version 3 also has great TypeScript coverage that helps with writing correct code faster and catching issues much earlier in the development cycle.

For example: custom fields in Chargebee always begin with cf_

With the new SDK, if you try to name the custom field something else, TypeScript will point it out with that beautiful, signature squiggly line 😄

An example of passing a custom field when creating a customer in Chargebee.

An example of passing a custom field when creating a customer in Chargebee.

The type inference for response is far better as well.

The screenshot below shows a code sample for creating a customer in Chargebee in the old version of the SDK. If you look closer, it returns a generic customer object.

A code sample that illustrates the creation of a customer in Chargebee using the older version of the SDK. Note that the response doesn’t have proper TypeScript definition.

A code sample that illustrates the creation of a customer in Chargebee using the older version of the SDK. Note that the response doesn’t have proper TypeScript definition.

Compare this with the same sample in the new SDK version below:

A code sample that illustrates the creation of a customer in Chargebee using the new version of the SDK. Note that the response has proper TypeScript definition and is inferred correctly.

A code sample that illustrates the creation of a customer in Chargebee using the new version of the SDK. Note that the response has proper TypeScript definition and is inferred correctly.

What’s next?

We plan to improve the SDK experience further with more contextual documentation and the ability to use your own HTTP client for added flexibility. We’re not stopping there. This release sets a high standard for the other SDK updates we’re starting to work on.

If you’re a developer building with Chargebee, there are more exciting things coming your way!

A note on how we build: We auto-generate client libraries in seven different programming languages using a custom code generator (curious about how that works? Leave a comment, we’d love to share 😉) based on our OpenAPI spec.

If you have any feedback/comments/questions, please feel free to reach out to dx[at]chargebee[dot]com.

— Chargebee DX Team


메타데이터
post_id
2b58a5dde632
slug
chargebees-node-js-sdk-gets-a-long-due-makeover-2b58a5dde632
url
https://medium.com/chargebee-engineering/chargebees-node-js-sdk-gets-a-long-due-makeover-2b58a5dde632
canonical_url
https://medium.com/chargebee-engineering/chargebees-node-js-sdk-gets-a-long-due-makeover-2b58a5dde632
author_url
https://medium.com/@tsriram
status
ok
fetched_at
2026-07-07 18:25:49