Skip to main content
FetchProvider is the lightest option in GitResolve’s provider stack. It uses the fetch API that ships with Node.js 18+ to download page HTML over HTTP, without spinning up a browser process or requiring any additional packages. Because no external module needs to be imported, isAvailable() always returns true — making it the guaranteed fallback at the end of the auto-detection chain.

When to use

  • Static portfolio sites and plain HTML pages that don’t rely on client-side rendering
  • GitHub and GitLab profile pages, which are server-rendered and work perfectly with a standard HTTP request
  • Constrained environments such as serverless functions, edge runtimes, or containers where installing a browser binary is not feasible
  • Fallback behaviour when neither Puppeteer nor Browserless is available
FetchProvider does not execute JavaScript. Single-page applications built with React, Vue, Next.js (client-only), or similar frameworks will return an empty shell or a loading spinner rather than real content. Use PuppeteerProvider or BrowserlessProvider for those sites.

Installation

No installation is required. FetchProvider depends only on the native fetch global available in Node.js 18 and later. If you have already installed @clyrisai/gitresolve, you are ready to go.

Usage

Direct instantiation

Via the factory

CLI

To use FetchProvider from the command line, set the BROWSER_PROVIDER environment variable:

Options

Custom timeout example

Behaviour details

The Accept header is set to text/html,application/xhtml+xml on every request, which encourages servers to return a browser-friendly HTML response rather than a JSON or API payload.