Fetch
Officialv6.0.4@kubb/plugin-fetch
kubb add plugin-fetch
How-to guides
7 guides
Call operationsCall a generated function with grouped request options, read the typed result, and pass content types or native fetch settings for one call.Configure requestsSet the base URL, credentials, shared headers, and interceptors on the generated client, for every call or for one.Handle errorsCatch a ResponseError, return errors as values with throwOnError: false, and tell a 4xx or 5xx answer apart from a request that never completed.Migrate to v6Upgrade @kubb/plugin-fetch from v5 to v6, which runs on the shared client core from @kubb/plugin-client, the same core as @kubb/plugin-axios.Configure serializationChange how the generated client encodes parameters by their OpenAPI style and explode, and how it encodes and decodes bodies by media type.Server-sent eventsStream a text/event-stream or JSON Lines response as typed items, then stop, resume, and handle errors.Use a custom transportReplace the network send of the generated fetch client with another HTTP library or your own function.
