Skip to content

Conversation

@imsahsol
Copy link

Description

This update allows users to manage their own Hyperbrowser session and client separately if needed.

Example Usage

const client: HyperbrowserClient = new Hyperbrowser({
  apiKey: process.env.HYPERBROWSER_API_KEY,
});

const session: SessionDetail = await client.sessions.create({
  adblock: true,
  annoyances: true,
  enableWebRecording: false,
  proxyCountry: "US",
  proxyState: "CA",
  solveCaptchas: true,
  timeoutMinutes: 120,
  trackers: true,
  useProxy: true,
  useStealth: true,
});

const agent: HyperAgent = new HyperAgent({
  browserProvider: "Hyperbrowser",
  hyperbrowserConfig: {
    client,
    session,
  },
});

Additionally, users can pass the keepBrowserOpen option as true to attempt keeping the browser session alive:

const agent: HyperAgent = new HyperAgent({
  browserProvider: "Hyperbrowser",
  hyperbrowserConfig: {
    // Other options
    keepBrowserOpen: true,
  },
});

⚠️ Note: Even if keepBrowserOpen is set to true, the browser context will still be destroyed if the terminal running your agent process receives a SIGINT signal (e.g., when you manually stop the process with Ctrl+C).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant