Binds a generated API namespace to one specific client instance.
The generated client.gen.ts for each service exports a module-level
singleton, and every generated operation falls back to it
((options?.client ?? client)). Configuring a wrapper by mutating that
singleton means the last wrapper constructed wins: a second client silently
rebinds the first one's base URL and credentials, so requests — and API keys
— can go to the wrong server with no error.
Wrapping the namespace injects a per-instance client into every call, so
each wrapper is isolated. Call sites and types are unchanged.
Binds a generated API namespace to one specific client instance.
The generated
client.gen.tsfor each service exports a module-level singleton, and every generated operation falls back to it ((options?.client ?? client)). Configuring a wrapper by mutating that singleton means the last wrapper constructed wins: a second client silently rebinds the first one's base URL and credentials, so requests — and API keys — can go to the wrong server with no error.Wrapping the namespace injects a per-instance
clientinto every call, so each wrapper is isolated. Call sites and types are unchanged.