Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/clyrisai/gitresolve/llms.txt

Use this file to discover all available pages before exploring further.

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

import { FetchProvider } from '@clyrisai/gitresolve';

const provider = new FetchProvider();

const html = await provider.getPageContent('https://github.com/torvalds');
console.log(html.slice(0, 500));

await provider.cleanup(); // no-op, safe to call

Via the factory

import { createProvider } from '@clyrisai/gitresolve';

const provider = await createProvider('fetch');
const html = await provider.getPageContent('https://gitlab.com/someone');

CLI

To use FetchProvider from the command line, set the BROWSER_PROVIDER environment variable:
BROWSER_PROVIDER=fetch gitresolve resolve resume.pdf

Options

OptionTypeDefaultDescription
timeoutnumber15000Maximum milliseconds to wait for the response before aborting.
waitUntilN/ANot applicable. FetchProvider returns the raw HTTP response body as soon as it is fully received.

Custom timeout example

const html = await provider.getPageContent('https://github.com/torvalds', {
  timeout: 5000, // abort after 5 seconds
});

Behaviour details

PropertyValue
name'fetch'
User-AgentMozilla/5.0 (compatible; ClyrisBot/1.0)
Redirect handlingredirect: 'follow' — follows all HTTP redirects automatically
Non-2xx responsesThrows Error: Fetch failed with <status>: <statusText>
isAvailable()Always resolves to true
cleanup()No-op — there are no resources to release
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.

Build docs developers (and LLMs) love