Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@browserbasehq/sdk
Advanced tools
Browserbase is the best developer platform to reliably run, manage, and monitor headless browsers.
Get browsers' full control and leverage Browserbase's Infrastructure, Stealth Mode, and Session Debugger to power your automation, test suites, and LLM data retrievals.
npm install -S @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 i 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
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 3 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.