Skip to content
Officialv5.0.8MITkubb >=5.0.0node >=22

@kubb/plugin-ts

Generates TypeScript types and interfaces from your OpenAPI spec, the typed foundation the other Kubb plugins build on.

typescripttypesinterfacescodegenopenapi
Stijn Van Hulle

Stijn Van Hulle

@stijnvanhulle

Downloads
1.3M/ mo
Stars
8
Bundle size
611.5 kB
Updated
36m ago

Generate TypeScript definitions from OpenAPI schemas.

  • Types and interfaces for your API models.
  • Shared types for requests, responses, hooks, and mocks.

Installation

bun add -d @kubb/plugin-ts

Or run kubb add plugin-ts to install the version the Kubb registry pins and add pluginTs() to kubb.config.ts.

Dependencies

No plugin dependencies.

Example

kubb.config.ts
import { defineConfig } from 'kubb/config'
import { pluginTs } from '@kubb/plugin-ts'

export default defineConfig({
  input: './petStore.yaml',
  output: { path: './src/gen' },
  plugins: [
    pluginTs(),
  ],
})

See also