Skip to main content
This recipe creates a persistent Profile, logs in once with Stealth and managed proxies, and reuses the saved cookies and storage on subsequent scraping runs without re-authenticating. Required API key scopes: profiles.create, browser.sessions.create, browser.sessions.stop.

Prerequisites

  • HYPERBROWSER_API_KEY, PORTAL_EMAIL, and PORTAL_PASSWORD exported in your shell.
  • @hyperbrowser/sdk + playwright-core (TypeScript) or hyperbrowser + playwright (Python) installed.

Step 1: Seed an Authenticated Profile

Run an initial session with persistChanges: true.

Step 2: Fan Out Read-Only Workers

For concurrent scraping, mount the seeded profile with persistChanges: false so parallel sessions never overwrite each other’s saved state:
Want to keep credentials out of your application environment completely? Store them in Secrets & Vaults and use Credential Fill during Step 1.

Expected output

  • seedProfile() logs Profile seeded: <profile-id> and flushes the authenticated cookies and local storage into the profile when the session stops cleanly.
  • Each scrapePage() worker boots already logged in and returns the rendered <main> text without overwriting the shared profile.

Next Steps