Skip to content

Allow injecting fetch into TypeScript clients - #2

Merged
meoyawn merged 1 commit into
masterfrom
agent/inject-fetch-client
Aug 16, 2026
Merged

Allow injecting fetch into TypeScript clients#2
meoyawn merged 1 commit into
masterfrom
agent/inject-fetch-client

Conversation

@meoyawn

@meoyawn meoyawn commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an optional fetch implementation to generated TypeScript client options
  • dispatch final interceptor requests through the injected implementation
  • reuse injected fetch for SSE reconnects
  • update generated golden files

Root cause

Generated clients called globalThis.fetch directly, preventing callers from supplying a custom transport and bypassing it during SSE reconnects.

Impact

Consumers can now pass fetch through ClientOptions; existing consumers continue using globalThis.fetch by default.

Closes #1.

Validation

  • task check in packages/oasmith
  • root monorepo task check

@meoyawn
meoyawn marked this pull request as ready for review August 16, 2026 10:49
@meoyawn
meoyawn merged commit 4d48267 into master Aug 16, 2026
2 checks passed
@meoyawn
meoyawn deleted the agent/inject-fetch-client branch August 16, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow passing fetch to propagate OpenTelemetry traces

1 participant