TypeScript SDK generator V2
We have shipped a “v2” of our Node / TypeScript SDK generator, focused around dropping support for EOL versions of Node and removing node-fetch in favor of the now-stable built-in fetch.
Upgrading to the new SDK requires a major version bump for any 1.0 or later SDK, though typically most developers will not be required to change any code.
The new SDKs are lighter, more consistent, and have zero dependencies out of the box. We also took the opportunity to clean up a variety of details along the way.
- Native fetch support: node-fetch has been removed in favor of the native web Fetch API, as we have dropped support for Node 16 which did not include it as a stable builtin.
- Zero dependencies: All runtime dependencies have been removed!
- Clearer path parameters: Methods with multiple path parameters now use named arguments instead of positional ones.
- Automatic path parameter encoding: Path parameters are now automatically URI-encoded. If you were manually calling encodeURIComponent(), you should remove it.
- fetchOptions replaces httpAgent: The httpAgent option is removed. The new fetchOptions property can be used for things like proxy configuration, taking advantage of platform APIs.
- Consistent method naming: All delete operations now consistently use .delete() instead of .del().
- Simplified pagination: Pagination methods are simpler and more consistent. nextPageRequestOptions() replaces nextPageParams() and nextPageInfo().
- Lighter type system: Pagination classes are now simple type aliases instead of runtime classes.
- Streamlined file uploads: The deprecated and platform-specific fileFromPath helper has been removed. Instead, users can use fs.createReadStream or Bun.file directly.