Quick Start

This guide will help you get started with Waterfall-Fetch quickly and easily.

Installation

Basic Usage

Here’s a simple example of how to use Waterfall-Fetch:

import getHtml from "waterfall-fetch";

const url = "https://example.com";

// Basic usage
const result = await getHtml(url);

// Recommended usage with destructuring
const { html, error, success } = await getHtml(url);

if (success) {
	console.log(html);
} else {
	console.error(error);
}
Waterfall-Fetch supports destructuring, inspired by the Supabase API, allowing for clean and intuitive usage.

Environment Variables

All of these are optional and getHtml will work without them all. If you wish to use a remote headless browser service then simply include the API Key and all puppeteer requests will connect to this service. Only BROWSERLESS is currently supported.

HEADLESS  // Optional
NODE_ENV  // Optional
BROWSERLESS_API_KEY  // Optional
BROWSERBASE_API_KEY  // Optional //unsupported
BROWSER_SERVICE  // Optional

For more advanced usage and configuration options, check out our API Reference.