Skip to content

JavaScript library for AI browser automation using Playwright. Connect LLMs to web browsers for search, navigation, and complex task execution.

License

Notifications You must be signed in to change notification settings

datvt-pexdia/browser-use-js

Repository files navigation

Shows a black Browser Use Logo in light color mode and a white one in dark color mode.

browser-use-js 🤖

GitHub stars npm version License: MIT JavaScript Playwright LangChain

🌐 browser-use-js is a JavaScript port of the original Python project, making it easy to connect AI agents with web browsers using JavaScript.

Installation

# Using npm
npm install

# Install Playwright browsers
npx playwright install

Add your API keys to your .env file:

OPENAI_API_KEY=your_openai_api_key

Quick Start

import { Browser, BrowserConfig, Agent } from "browser-use-js";
import { ChatOpenAI } from "@langchain/openai";
import dotenv from "dotenv";
dotenv.config();

async function main() {
  const browser = new Browser(
    new BrowserConfig({
      headless: false,
      disableSecurity: true,
    })
  );

  const agent = new Agent({
    task: "Compare the price of gpt-4o and DeepSeek-V3",
    llm: new ChatOpenAI({
      modelName: "gpt-4o",
      temperature: 0.7,
    }),
    browser: browser,
    useVision: true,
  });

  await agent.run();
  await browser.close();
}

main().catch(console.error);

About

JavaScript library for AI browser automation using Playwright. Connect LLMs to web browsers for search, navigation, and complex task execution.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published