“You should maximize the time developers spend on their product and minimize the time spent with your SDK.”
Mux upgrades its client libraries to Stainless
“The only acceptable solution to going down the auto-generation route would be if it resulted in an SDK that was much better than our current one. This was a hard line we weren’t willing to compromise on.”
Mux is a video streaming API that provides developers with tools to build and manage high-quality video experiences within their applications. The API simplifies the complexities of video encoding, hosting, and delivery through a robust set of features that include automatic adjustments for streaming quality based on the viewer's bandwidth.
Before Stainless, Mux had a six-year-old Node SDK for making server-side API requests. It was originally written in JavaScript (not TypeScript) and they added types by hand over the years, laying on code as they tried to keep up with Mux's evolving platform.
Over the past few years, the mux-node SDK hadn’t been living up to their standards. It was difficult to maintain, had TypeScript inconsistencies, and lacked support for the increasingly diverse ecosystem of modern JavaScript runtimes. They needed to rethink their SDK strategy and find a solution that satisfied all of those requirements.
“Lucky for us, we got in touch with the folks from Stainless.”
Based on their previous experience with code generation, they were skeptical that it would meet their needs, but the SDKs generated by Stainless exceeded their expectations. The latest mux-node SDK in production now is produced by Stainless. It gives them:
And other nice quality-of-life things that they were missing before:
“Big breaking changes suck, and you should (almost) never do them.”
Mux adhered to a philosophy of avoiding significant breaking changes in its SDK. The company recognized the substantial burden such updates place on developers, requiring extensive code alterations, rigorous testing, and deployment processes—all detracting from product development time. However, the growing technical debt and maintenance challenges of the legacy SDK compelled Mux to reconsider this stance. With ~100k downloads per week, Node is their most popular server-side SDK, so they did not take the decision to make a clean break lightly.
To make for a smooth migration, Stainless helped provide a migration tool that performs a codemod to enable developers upgrade from their legacy SDK to the new SDK generated by Stainless. Running this local script modifies all existing code and updates it to the new SDK.
Keeping up with the Node-ish ecosystem : Mux's migration to Stainless
“Now we feel like we’re in a place where we can scale the usage of this SDK to 1 million and 10 million weekly downloads.”