Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@browserbasehq/sdk
Advanced tools
Browserbase is the best developer platform to reliably run, manage, and monitor headless browsers. Leverage Browserbase to power your automation, test suites, and LLM data retrievals.
npm install @browserbasehq/sdk
import { Browserbase } from '@browserbasehq/sdk'
// Init the SDK
const browserbase = new Browserbase()
// Load a webpage
const rawHtml = await browserbase.load('https://www.browserbase.com')
// Load multiple webpages (returns iterator)
const rawHtmls = browserbase.loadURLs([
'https://www.browserbase.com',
'https://docs.browserbase.com',
])
for await (let rawHtml of rawHtmls) {
// ...
}
// Text-only mode
const text = await browserbase.load('https://www.browserbase.com', {
textContent: true,
})
// Screenshot (returns bytes)
const result = await browserbase.screenshot('https://www.browserbase.com', {
textContent: true,
})
Install the additional dependencies:
npm install ai openai zod
import OpenAI from 'openai'
import { Browserbase, BrowserbaseAISDK } from '@browserbasehq/sdk'
import {
OpenAIStream,
StreamingTextResponse,
generateText,
} from 'ai'
// Create new OpenAI client
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
})
// Init the Browserbase SDK
const browserbase = new Browserbase()
// Init the tool
const browserTool = BrowserbaseAISDK(browserbase, { textContent: true })
// Load completions
const result = await generateText({
model: openai.chat('gpt-3.5-turbo'),
tools: {
browserTool,
},
prompt: 'What is the weather in San Francisco?',
})
FAQs
The official Node.js library for the Browserbase API
The npm package @browserbasehq/sdk receives a total of 86,300 weekly downloads. As such, @browserbasehq/sdk popularity was classified as popular.
We found that @browserbasehq/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.