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

How We Built It - Universal Typescript

Blog post from Speakeasy

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

The blog post discusses the development of a new TypeScript SDK generator aimed at addressing the shortcomings of existing open-source generators for enterprise API offerings. The initial version, although better than open-source alternatives, faced challenges with de/serialization and lacked flexibility, prompting the creation of a more robust version that leverages TypeScript and OpenAPI primitives. A key improvement is the integration of Zod for schema validation, enhancing runtime type safety for API inputs and outputs. Additionally, the new SDK transitions from Axios to the native fetch API and enables tree-shaking, allowing for a single codebase that can operate across diverse environments like Node.js, browsers, and serverless functions. The generator also introduces support for data streams, including file uploads and downloads, as well as server-sent events, catering to the growing demand from AI APIs. These updates aim to provide a more efficient, scalable, and user-friendly tool for developers while maintaining enterprise-level functionality and reliability.