Skip to content

Class-based SDK

Set sdk to emit a class-based client, one class per tag with mode: 'tag' or a single flat class with mode: 'flat'.

kubb.config.ts
typescript
import { 
defineConfig
} from 'kubb/config'
import {
pluginTs
} from '@kubb/plugin-ts'
import {
pluginFetch
} from '@kubb/plugin-fetch'
export default
defineConfig
({
input
: './petStore.yaml',
output
: {
path
: './src/gen',
clean
: true },
plugins
: [
pluginTs
(),
pluginFetch
({
sdk
: {
mode
: 'tag' },
}), ], })