1

Get your API Key

Go over the Dashboard’s Settings tab:

Then, copy your API Key directly from the input and set the BROWSERBASE_API_KEY environment variable.

2

Install the Browserbase SDK

  npm i @browserbasehq/sdk
3

Load documents or images

Load documents


import { BrowserbaseLoader } from "@langchain/community/document_loaders/web/browserbase";

const loader = new BrowserbaseLoader(["https://example.com"], {
textContent: true,
});

async function loadDocs() {
const docs = await loader.load();
return docs;
}

loadDocs();

The default value textContent: false will return HTML as a LlamaIndex Document. Setting textContent: true will return LlamaIndex Document with text only.