Case study

Typed TypeScript SDKs generated from OpenAPI specs

A generator that turns OpenAPI specs into typed TypeScript SDKs: one package per service, with the same version as each API release.

Context

The client is a cosmetics retailer that sells through its web store, its app and its own stores. An API layer sits between the back-end systems and the channels, such as the web store and the app, and each service in that layer has an OpenAPI spec.

Our role

We worked in the client’s architecture team, where we wrote the proposal and built the generator. The services themselves did not change.

Goal

  • Give each channel typed functions for each service.
  • Generate the functions from the spec, so they match the API.
  • Tie the SDK version to the version of the service.
  • Let each channel use its own fetch function.

What we did

  1. Proposal (October 2026). We wrote the requirements: one package per service, a version tied to the spec, a custom fetch function per channel, and generation in the API repository.
  2. Generator (November 2026). Orval turns each spec into plain fetch functions and types, and a build step then makes one package per service. The generator covers 8 services, such as catalog, checkout and account.
  3. Responses. The SDK functions never throw an error but unwrap the response envelope of the API and return data, an error and metadata. Every kind of error, such as validation, gateway or network errors, becomes one error type.
  4. Type tests. Each service has a type test that pins its public API and also shows how to use the SDK.
  5. Releases. When a service is released, the pipeline exports its spec and publishes the SDK with the same version number.
Let's connect

Talk about your project

Tell us about your team and your problem. In 30 minutes we find out whether one of our offers fits, and if none does, we tell you.

Book a 30-minute call