docs: add Interceptors API reference page#5446
Open
enjoykumawat wants to merge 2 commits into
Open
Conversation
Adds docs/docs/api/Interceptors.md documenting all eight built-in interceptors (dump, retry, redirect, decompress, responseError, dns, cache, deduplicate) with their options, defaults, and usage examples. Updates docs/docs/site.json to surface the new page in the sidebar under a dedicated Interceptors group. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
metcoder95
reviewed
Jun 21, 2026
metcoder95
left a comment
Member
There was a problem hiding this comment.
I'm +1 on moving the interceptors docs in a new place, but we need to also cleanup what is in the Dispatcher section; just keeping the description of the Dispatcher#compose and how does, and linking the interceptors list to this
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5446 +/- ##
=======================================
Coverage 93.46% 93.47%
=======================================
Files 110 110
Lines 37106 37106
=======================================
+ Hits 34682 34684 +2
+ Misses 2424 2422 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Remove the full 'Pre-built interceptors' section from Dispatcher.md and replace it with a short pointer to the new Interceptors.md page. Also add a direct link to Interceptors.md from the dispatcher.compose() section, and drop link-reference entries that are no longer needed. Addresses feedback from metcoder95 on nodejs#5446.
metcoder95
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/docs/api/Interceptors.md— a comprehensive API reference for all eight built-in interceptors (dump,retry,redirect,decompress,responseError,dns,cache,deduplicate), covering constructor options, defaults, per-request overrides, and usage examples.docs/docs/site.jsonto include the new page in the sidebar under a dedicated Interceptors group (between Proxy & Agents and Handlers).Closes #886 (connect option needs more tests and docs — the
connectoption documentation gap is part of the broader missing interceptors docs).What changed
docs/docs/api/Interceptors.md— new file documenting:interceptors.dump([opts])—maxSize, per-requestdumpMaxSizeoverrideinterceptors.retry([opts])— links to RetryHandler optionsinterceptors.redirect([opts])—maxRedirections,throwOnMaxRedirect,stripHeadersOnRedirect,stripHeadersOnCrossOriginRedirectinterceptors.decompress([opts])—skipStatusCodes,skipErrorResponses, experimental warning noteinterceptors.responseError([opts])— error body decoding behaviourinterceptors.dns([opts])—maxTTL,maxItems,dualStack,affinity, customlookup/pick/storageinterceptors.cache([opts])— links to CacheStore docsinterceptors.deduplicate([opts])—methods,skipHeaderNames,excludeHeaderNames,maxBufferSizedocs/docs/site.json— adds{ "link": "/api/Interceptors", "label": "Interceptors" }under a new Interceptors sidebar group.Test plan
types/interceptors.d.ts