Home / Companies / Speakeasy / Blog / Post Details
Content Deep Dive

Introducing Universal TypeScript: A TS SDK your users will love

Blog post from Speakeasy

Post Details
Company
Date Published
Author
Georges Haidar
Word Count
2,402
Language
English
Hacker News Points
-
Summary

An updated TypeScript code generation target has been introduced to enhance TypeScript SDKs built on OpenAPI, leveraging TypeScript's type system, native Fetch APIs, and the Zod library for data validation. These SDKs are compatible with both browsers and servers, supporting popular JavaScript runtimes like Node.js, Bun, Deno, and React Native. Notable features include user input and server response validation, polymorphic types, multipart streaming uploads, and server-sent events. The SDKs also improve tree-shaking performance, enabling users to import specific namespaces, and provide support for streaming, arbitrary-precision decimals, and big integers. The transition from Axios to the Fetch API as the HTTP client ensures compatibility across diverse environments without third-party dependencies. Breaking changes include updated SDK file structures and a shift towards ES2020 and Node.js v18+ support. Existing users can opt into the new generator through a configuration update, while new users will automatically benefit from these advancements.