Skip to main content
Puppeteer connects to a Surfsky browser over the session’s WebSocket URL instead of launching one itself. The browser runs in Surfsky’s cloud, so you do not need Chrome on your machine.
Puppeteer has known leaks that anti-bot scripts can detect. On sites with bot protection, use a patched fork such as rebrowser-puppeteer.
Use human-emulation commands for clicks, typing, and scrolling. Keep Puppeteer for navigation, selectors, waiting, and page content.

Prerequisites

Set your API token and base URL, then install the package for your language below. Puppeteer provides a JavaScript/TypeScript API. The Java and .NET examples use the community ports Jvppeteer and Puppeteer Sharp. For Python, use async Playwright: the Python port Pyppeteer is unmaintained. The examples use your account’s default proxy pool. Proxy, fingerprint, and other start options are in the API reference.

Run an example

The examples use a one-time profile. To reuse a saved login, pass a persistent profile UUID to the session call instead.
Requires Node.js 24 or newer, or Bun, for await using. Puppeteer’s JavaScript API is asynchronous; the same calls work in TypeScript.
Save as surfsky-puppeteer.mjs:
Run it:
Expected output:
defaultViewport: null keeps the window size from the profile’s fingerprint. Without it Puppeteer forces its own 800x600 viewport.

Click, type, and scroll

Prefer human emulation over Puppeteer’s own click, type, and scroll. Human.* commands move the cursor and type with human timing, and they run through a page-level CDP session. Replace the selector with an input on your page:

Stop the session

In the JavaScript example, browser.disconnect() only drops the Puppeteer connection; the SDK stops the browser when the session scope exits, including on errors. The Java and .NET examples close the remote browser in finally. If you start a session through the API and the framework cannot connect, stop it using the internal_uuid from the start response:
Otherwise the browser stops after the inactivity timeout.