Skip to content

docs: document custom fetch option - #613

Open
vittorioexp wants to merge 1 commit into
unjs:mainfrom
vittorioexp:docs/custom-fetch-option
Open

docs: document custom fetch option#613
vittorioexp wants to merge 1 commit into
unjs:mainfrom
vittorioexp:docs/custom-fetch-option

Conversation

@vittorioexp

@vittorioexp vittorioexp commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Closes #533.

Documents the fetch option for createFetch and ofetch.create, which lets callers plug in a custom Fetch API implementation.

Test plan

  • Verified against src/fetch.ts and CreateFetchOptions in src/types.ts
  • README-only change

Summary by CodeRabbit

  • Documentation
    • Added guidance for configuring a custom fetch implementation.
    • Included examples using supported configuration methods.
    • Documented the required standard fetch(input, init?) signature and compatibility with existing features such as retries, hooks, and JSON body handling.

Document the fetch option on createFetch and ofetch.create. Closes unjs#533.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd8251a4-fed6-48fa-bee4-f898f9f07940

📥 Commits

Reviewing files that changed from the base of the PR and between 1dbc37f and aa9a74d.

📒 Files selected for processing (1)
  • README.md

📝 Walkthrough

Walkthrough

Changes

Custom fetch documentation

Layer / File(s) Summary
Document custom fetch configuration
README.md
Adds examples and guidance for supplying a custom fetch through createFetch or ofetch.create, including the required standard signature and preserved ofetch features.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: maxtaran2010

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the README docs update for the custom fetch option.
Linked Issues check ✅ Passed The README now documents passing a custom fetch function, matching issue #533.
Out of Scope Changes check ✅ Passed The change is limited to README documentation and stays within the stated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Ability to pass in custom fetch fn is not documented

1 participant