Overview
ThecreateFetch function allows you to create customized instances of ofetch with predefined defaults and global options.
Type Signature
Usage
Parameters
CreateFetchOptions
Global configuration for the fetch instance
CreateFetchOptions
defaults
FetchOptions
Default FetchOptions to apply to all requests made with this instance. These can be overridden on a per-request basis.
fetch
Fetch
Custom fetch implementation to use instead of
globalThis.fetch. Useful for providing polyfills or custom fetch behavior.Examples
API Client with Authentication
Custom Retry Configuration
Node.js with Custom Fetch
Related
- ofetch.create() - Create instances from existing ofetch
- FetchOptions - Available default options
- $Fetch - Return type interface