Static IPs

Static IP usage is another powerful feature of Hyperbrowser, allowing users to maintain a consistent IP address across sessions. This feature can be essential for activities requiring a stable connection identity.

import { connect } from "puppeteer-core";
import { Hyperbrowser } from "@hyperbrowser/sdk";
import { config } from "dotenv";

config();

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

const main = async () => {
  const session = await client.sessions.create({
    useProxy: true,
    staticIpId: "<STATIC_IP_ID>",
  });

  try {
    const browser = await connect({
      browserWSEndpoint: session.wsEndpoint,
      defaultViewport: null,
    });

    const [page] = await browser.pages();

    // Navigation
    console.log("Using Static IP to navigate to Hacker News...");
    await page.goto("https://news.ycombinator.com/");
    const pageTitle = await page.title();
    console.log("Page title:", pageTitle);
  } catch (err) {
    console.error(`Encountered error: ${err}`);
  } finally {
    await client.sessions.stop(session.id);
  }
};

main();

Management of static IP and corresponding user must be performed on the client side. Hyperbrowser maintains no inherent association between users and static IPs.

Access to static IPs is only available on PAID plans at request. If you, or your team, require static IPs let us know.

Last updated