Repository navigation
docs: replace the removed agent proxy option with fetch on the web-api and webhook pages - #2880
Conversation
…i and webhook pages Co-Authored-By: Claude <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2880 +/- ##
==========================================
+ Coverage 94.41% 94.46% +0.04%
==========================================
Files 68 68
Lines 10942 10942
Branches 696 693 -3
==========================================
+ Hits 10331 10336 +5
+ Misses 580 575 -5
Partials 31 31
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
cchensh
left a comment
There was a problem hiding this comment.
LGTM. This matches the code: agent is gone, fetch is the option on both WebClientOptions and IncomingWebhook and defaults to globalThis.fetch, and the ProxyAgent/dispatcher samples are right. Follow-up: the v8 migration guides (migrating-web-api-package-to-v8.md:76 and the matching webhook section) still show undici's own fetch, which the description says breaks files.uploadV2. Nit: the new samples are ESM with top-level await, while the rest of the page is CommonJS.
|
🌟 Thanks for the kind review @cchensh! The migration guide follow-up is a great catch 🔌 |
Summary
This pull request updates the "Proxy requests" sections of the
@slack/web-apiand@slack/webhookdocs, since v8 of both packages removed theagentoption these sections described.NODE_USE_ENV_PROXY=1(v22.21.0, v24.0.0, or later) orhttp.setGlobalProxyFromEnv()(v24.14.0 or later).fetchoption alternative that passes an undiciProxyAgentas thedispatchertoglobalThis.fetch, with the undici major that matches Node.js from the long-term support table. KeepingglobalThis.fetchkeepsfiles.uploadV2working, since undici's ownfetchdoesn't recognize the globalFormDataused for uploads, and anundici@8ProxyAgentfails with thefetchin Node.js v24.#proxy-requests-with-a-custom-agentanchor changes.Tested against a local forwarding proxy with
@slack/[email protected],@slack/[email protected]and[email protected], checkingchat.postMessage,files.uploadV2(the proxy received the multipart body), a webhooksend, andapi.testtoslack.comover a CONNECT tunnel:undici@7dispatcherNODE_USE_ENV_PROXY=1http.setGlobalProxyFromEnv()Notes
agentoption row (docs/japanese/reference.md:92), which could be updated in a follow-up.Requirements
🤖 Generated with Claude Code