diff --git a/.changeset/sleek-otters-pass-fetch.md b/.changeset/sleek-otters-pass-fetch.md new file mode 100644 index 00000000..98cce839 --- /dev/null +++ b/.changeset/sleek-otters-pass-fetch.md @@ -0,0 +1,5 @@ +--- +"partytracks": patch +--- + +Pass `options.fetch` to `fromFetch` when fetching `/generate-ice-servers`. The matching `sessions/new` request already uses it, so a consumer that wires up a custom `fetch` via `PartyTracksConfig.fetch` (for auth headers, tracing, retries, request signing, etc.) now gets it applied uniformly across both calls instead of just one. No behavior change for consumers that don't pass a custom fetch — `fetchImpl` defaults to the global `fetch` in `fromFetch.ts`. diff --git a/packages/partytracks/src/client/PartyTracks.ts b/packages/partytracks/src/client/PartyTracks.ts index 3546f621..fcb00c81 100644 --- a/packages/partytracks/src/client/PartyTracks.ts +++ b/packages/partytracks/src/client/PartyTracks.ts @@ -761,6 +761,7 @@ function makePeerConnectionSessionCombo(options: { iceServers: options.iceServers ? of(options.iceServers) : fromFetch(`${options.prefix}/generate-ice-servers`, { + fetchImpl: options.fetch, selector: (res) => res .json()