Skip to content

About openapi-typescript

Used by

  • Bigcommerce: Node SDK for the BigCommerce API
  • Budibase: low code platform for creating internal tools, workflows, and admin panels
  • Fedora fmn: tools and APIs for Fedora’s messaging infra
  • Fingerprint: device fingerprinting for high-scale applications
  • Google Firebase CLI: Official CLI for Google’s Firebase platform
  • GitHub Octokit: Official SDK for the GitHub API
  • Lotus: open source pricing & packaging infra
  • Jitsu: modern, open source data ingestion / data pipelines
  • Medusa: building blocks for digital commerce
  • Netlify: the modern development platform
  • Nuxt: The Intuitive Vue framework
  • Relevance AI: build and deploy AI chains
  • Revolt: open source user-first chat platform
  • Spacebar: a free, open source, self-hostable Discord-compatible chat/voice/video platform
  • Supabase: The open source Firebase alternative.
  • Twitter API: Official SDK for the Twitter API

Project goals

  1. Support converting any valid OpenAPI schema to TypeScript types, no matter how complicated.
  2. Generated types should be statically-analyzable and runtime-free (with minor exceptions like enums.
  3. Generated types should match your original schema as closely as possible, preserving original capitalization, etc.
  4. Typegen only needs Node.js to run (no Java, Python, etc.) and works in any environment.
  5. Support fetching OpenAPI schemas from files as well as local and remote servers.

Differences

vs. swagger-codegen

openapi-typescript was created specifically to be a lighter-weight, easier-to-use alternative to swagger-codegen that doesn’t require the Java runtime or running an OpenAPI server. Nor does it generate heavyweight client-side code. In fact, all the code openapi-typescript generates is runtime free static types for maximum performance and minimum client weight.

vs. openapi-typescript-codegen

These 2 projects are unrelated. openapi-typescript-codegen is a Node.js alternative to the original swagger-codegen, but ends up being the same in practice. openapi-typescript has the same advantage of being runtime free whereas openapi-typescript-codegen can generate some pretty heavy bundles, up to 250 kB or more depending on the schema complexity.

vs. tRPC

tRPC is an opinionated type-safe framework for both server and client. It demands both your server and client be written in tRPC (which means Node.js for the backend).

If you fit into this use case, it’s a great experience! But for everyone else, openapi-typescript (and openapi-fetch) is a more flexible, lower-level solution that can work for any technology choice (or even be incrementally-adopted without any cost).

Contributors

This library wouldn’t be possible without all these amazing contributors:

Drew Powers

Drew Powers

Przemek Smyrdek

Przemek Smyrdek

Dan Enman

Dan Enman

Atle Frenvik Sveen

Atle Frenvik Sveen

Tim de Wolf

Tim de Wolf

Tom Barton

Tom Barton

Sven Nicolai Viig

Sven Nicolai Viig

Sorin Davidoi

Sorin Davidoi

Nathan Schneirov

Nathan Schneirov

Lucien Bénié

Lucien Bénié

Boris K

Boris K

Anton Kastritskii

Anton Kastritskii

Tim Shelburne

Tim Shelburne

Michał Miszczyszyn

Michał Miszczyszyn

Sam K Hall

Sam K Hall

Matt Jeanes

Matt Jeanes

Kristofer Giltvedt Selbekk

Kristofer Giltvedt Selbekk

Elliana May

Elliana May

Henrik Hall

Henrik Hall

Gregor Martynus

Gregor Martynus

Sam Mesterton-Gibbons

Sam Mesterton-Gibbons

Rendall

Rendall

Robert Massaioli

Robert Massaioli

Jan Kuča

Jan Kuča

Thomas Valadez

Thomas Valadez

Asitha de Silva

Asitha de Silva

Misha

Misha

Alex Batalov

Alex Batalov

Federico Bevione

Federico Bevione

Daisuke Yamamoto

Daisuke Yamamoto

Ash Smith

Ash Smith

Micah Halter

Micah Halter

chrg1001

chrg1001

Dakshraj Sharma

Dakshraj Sharma

Shaosu Liu

Shaosu Liu

Vytenis

Vytenis

Eric Zorn

Eric Zorn

Max Belsky

Max Belsky

Peter Bech

Peter Bech

Rusty Conover

Rusty Conover

Dave Carlson

Dave Carlson

Artem Shuvaev

Artem Shuvaev

Dominik Dosoudil

Dominik Dosoudil

kgtkr

kgtkr

Philip Trauner

Philip Trauner

Pavel Yermolin

Pavel Yermolin

Duncan Beevers

Duncan Beevers

Timofei Kukushkin

Timofei Kukushkin

Dmitry Semigradsky

Dmitry Semigradsky

Jeremy Liberman

Jeremy Liberman

Axel Hernández Ferrera

Axel Hernández Ferrera

Loïc Fürhoff

Loïc Fürhoff

Bartosz Szczeciński

Bartosz Szczeciński

Marco Salomone

Marco Salomone

Yacine Hmito

Yacine Hmito

Sajad Torkamani

Sajad Torkamani

Marius van den Beek

Marius van den Beek

Steven Grimm

Steven Grimm

Erik Hughes

Erik Hughes

Matthieu Monsch

Matthieu Monsch

Mitchell Merry

Mitchell Merry

François Risoud

François Risoud

liangsky

liangsky

Don Denton

Don Denton

Yad Smood

Yad Smood

barak

barak

Lukáš Horák

Lukáš Horák

Andrea Carraro

Andrea Carraro

psychedelicious

psychedelicious

Tanguy Krotoff

Tanguy Krotoff

Pim Veldhuisen

Pim Veldhuisen

Aleksandr Vishniakov

Aleksandr Vishniakov

Ahsan Fazal

Ahsan Fazal

Eugene Dzhumak

Eugene Dzhumak

Mohammed Gadi

Mohammed Gadi

Adam K

Adam K

Christoph Fricke

Christoph Fricke

Jorrin

Jorrin

Nick Williams

Nick Williams

hrsh7th

hrsh7th

David Leger

David Leger

Hongkun

Hongkun

Matthias Zronek

Matthias Zronek

Łukasz Wiśniewski

Łukasz Wiśniewski

Jean-Rémi Delteil

Jean-Rémi Delteil

Tzvi Melamed

Tzvi Melamed

ehrenschwan

ehrenschwan

Niccolo Zapponi

Niccolo Zapponi

Marvin Luchs

Marvin Luchs

Neil MacMunn

Neil MacMunn