New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

browser-use-convex-component

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-use-convex-component

A Convex component for Browser Use Cloud - automate browser tasks with AI agents

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Browser Use Convex Component

A Convex component that wraps the Browser Use Cloud API, enabling AI-powered browser automation with persistent task tracking, session management, and reactive queries.

Features

  • Task Management - Create, monitor, and stop browser automation tasks
  • Session Management - Create persistent browser sessions with proxy support
  • Profile Management - Manage browser profiles for authentication persistence
  • Reactive Queries - All task and session data stored in Convex for real-time subscriptions

Installation

npm install browser-use-convex-component

Setup

1. Configure your app

In your convex/convex.config.ts:

import { defineApp } from "convex/server";
import browserUse from "browser-use-convex-component/convex.config.js";

const app = defineApp();
app.use(browserUse);

export default app;

2. Set your API key

Set the BROWSER_USE_API_KEY environment variable in your Convex deployment:

npx convex env set BROWSER_USE_API_KEY bu_your_api_key_here

Usage

Initialize the client

import { BrowserUse } from "browser-use-convex-component";
import { components } from "./_generated/api.js";

const browserUse = new BrowserUse(components.browserUse);

Create a task

export const startTask = action({
  args: { task: v.string() },
  returns: v.any(),
  handler: async (ctx, args) => {
    const { taskId, externalId } = await browserUse.createTask(ctx, {
      task: args.task,
      startUrl: "https://example.com",
    });
    return { taskId, externalId };
  },
});

Query tasks reactively

export const listTasks = query({
  args: {},
  returns: v.any(),
  handler: async (ctx) => {
    return await browserUse.listTasks(ctx);
  },
});

Check task status

export const checkTask = action({
  args: { externalId: v.string() },
  returns: v.any(),
  handler: async (ctx, args) => {
    return await browserUse.fetchTaskStatus(ctx, args);
  },
});

Session management

export const createSession = action({
  args: {},
  returns: v.any(),
  handler: async (ctx) => {
    return await browserUse.createSession(ctx, {
      proxyCountryCode: "us",
    });
  },
});

Profile management

export const listProfiles = action({
  args: {},
  returns: v.any(),
  handler: async (ctx) => {
    return await browserUse.listProfiles(ctx);
  },
});

API Reference

Tasks

MethodTypeDescription
createTask(ctx, args)ActionCreate a browser automation task
getTask(ctx, { taskId })QueryGet task from local DB
listTasks(ctx, opts?)QueryList tasks with optional filters
getTaskSteps(ctx, { taskId })QueryGet step-by-step execution details
fetchTaskStatus(ctx, { externalId })ActionFetch latest status from API
fetchTaskDetail(ctx, { externalId })ActionFetch full details and steps from API
stopTask(ctx, { externalId })ActionStop a running task

Sessions

MethodTypeDescription
createSession(ctx, args?)ActionCreate a browser session
getSession(ctx, { sessionId })QueryGet session from local DB
listSessions(ctx, opts?)QueryList sessions with optional filters
fetchSessionDetail(ctx, { externalId })ActionFetch session details from API
stopSession(ctx, { externalId })ActionStop a session

Profiles

MethodTypeDescription
createProfile(ctx, args?)ActionCreate a browser profile
listProfiles(ctx)ActionList all profiles
getProfile(ctx, { profileId })ActionGet profile details
updateProfile(ctx, { profileId, name })ActionUpdate profile name
deleteProfile(ctx, { profileId })ActionDelete a profile

Task Options

OptionTypeDescription
taskstringThe instruction for the AI agent (required)
llmstringAI model (default: browser-use-2.0)
sessionIdstringExisting session to use
startUrlstringInitial URL to navigate to
maxStepsnumberMax execution steps (default: 100)
flashModebooleanAccelerated execution mode
thinkingbooleanExtended reasoning
visionboolean | "auto"Visual recognition
highlightElementsbooleanHighlight interactive elements
systemPromptExtensionstringAppend to the system prompt
structuredOutputobjectJSON schema for response formatting
secretsobjectSecure key-value data injection
allowedDomainsstring[]Navigation restrictions
metadataobjectCustom tracking pairs
judgebooleanAI-powered success validation
judgeGroundTruthstringGround truth for judge evaluation
judgeLlmstringModel for judge evaluation
skillIdsstring[]Pre-built skill IDs to use

License

MIT

Keywords

convex

FAQs

Package last updated on 14 Feb 2026

Related posts