Plugin
plugins: [pluginClient()]Officialv5.5.8kubb >=5.8.0node >=22
Client
@kubb/plugin-client
Generates typed operation functions from your OpenAPI spec that call a client module you own, so you decide the transport, auth, and error handling.
kubb add plugin-client
api-clienthttp-clientcodegenopenapi
- Downloads469.3K/ monthnpm, last 30 days
- GitHub stars8kubb-labs/plugins
- Unpacked size303.5kBv5.5.8 on npm
- Latest release1h agov5.5.8 · Oct 13, 2026
Generates typed operation functions from your OpenAPI spec that call a client module you write. You decide the transport, authentication, and error handling, and the generated code has no Fetch, axios, or Kubb runtime dependency.
Use it for signed requests, a shared client, or an existing HTTP layer. For a ready-made client, use @kubb/plugin-fetch or @kubb/plugin-axios instead.
Installation
bun add -d @kubb/plugin-clientpnpm add -D @kubb/plugin-clientnpm install --save-dev @kubb/plugin-clientyarn add -D @kubb/plugin-clientOr run kubb add plugin-client to install the version the Kubb registry pins and add pluginClient() to kubb.config.ts.
Setup
- Set
importPathto your client module. It is required. The module must exportclientand theOptionsandRequestResulttypes. - Add
@kubb/plugin-tsfor the operation types. - Add
@kubb/plugin-zodwhen you setvalidator. Generation fails without it.
Options worth knowing
importPathis written into every generated import as given, so it must resolve from the generated file. A relative path, a package name, or an alias works.validator: 'zod'passes request and response schemas from@kubb/plugin-zodto your client.throwOnErrorDefaultis thethrowOnErrorvalue each call passes to your client. The default istrue.
Dependencies
No extension dependencies.