Replies: 1 comment
-
|
@Luc-cpl Good idea, let use have a look at implementing this, I will move this to an issue to follow up. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
In my current use case it would be awesome if we could have a class-based client instead of the current function-based approach for client operations.
Kubb is very useful for building integrations with other platforms’ APIs in our SaaS — we just set a new config with the OpenAPI spec, and most of the heavy lifting is done automatically, with far fewer type issues.
However, as we handle queue-based mass integrations, relying on a centralized axios client doesn’t work. Right now, Kubb allows passing a custom client into generated functions, but that’s not very practical:
Instead, I think it would be more reliable if
@kubb/plugin-clientsupported generating classes with a centralized config per instance. That way we could share the client instance across calls, and we wouldn’t need to worry about injecting the custom fetcher on every operation.Currently, we’re working around this by wrapping Kubb’s functions like so:
Proposal:
Add an option in
@kubb/plugin-clientto generate class-based clients instead of functions, with centralized configuration per instance.This approach would reduce possible errors and make it easier to reuse configured clients across different function calls.
Beta Was this translation helpful? Give feedback.
All reactions