Plugin
plugins: [pluginTs()]Officialv5.0.9kubb >=5.8.0node >=22
TypeScript
@kubb/plugin-ts
Generates TypeScript types and interfaces from your OpenAPI spec, the typed foundation the other Kubb plugins build on.
kubb add plugin-ts
typescripttypesinterfacescodegenopenapi
- Downloads1.3M/ monthnpm, last 30 days
- GitHub stars8kubb-labs/plugins
- Unpacked size625.6kBv5.0.9 on npm
- Latest release40m agov5.0.9 · Oct 13, 2026
Generates TypeScript types and interfaces from your OpenAPI spec. You get a type for every schema, plus the request, response, and parameter types of each operation.
Most other Kubb plugins build on these types. The client, query, mock, and test plugins import them, so add this plugin first.
Installation
bun add -d @kubb/plugin-tspnpm add -D @kubb/plugin-tsnpm install --save-dev @kubb/plugin-tsyarn add -D @kubb/plugin-tsOr run kubb add plugin-ts to install the version the Kubb registry pins and add pluginTs() to kubb.config.ts.
Setup
No other plugins or packages are needed.
Options worth knowing
enum.typesets how enums are written:asConst(default),enum,constEnum,literal, orinlineLiteral.enum.constCasing,enum.typeSuffix, andenum.keyCasingtune the names.syntaxTypewrites object schemas astypealiases (default) orinterfacedeclarations.optionalTypesets how optional properties are written:questionToken(default),undefined, orquestionTokenAndUndefined.arrayTypewrites arrays asT[](default) orArray<T>.groupsplits the output into folders by tag or path. It does not work withoutput.mode: 'file'.
Dependencies
No extension dependencies.