Features

How do I automate browser profiles with Playwright, Puppeteer or Selenium?

Updated December 5, 2026

Use the Mirage SDK for TypeScript or Python. It finds the running app through its Local API, starts a profile with its own fingerprint and proxy, and connects Playwright. Chrome profiles also take Puppeteer and Selenium. A humanize helper moves the mouse along curved paths and types with uneven pauses. The SDK is published with the public beta.

Mirage Browser: the quick start for the CLI, TypeScript and PythonMirage Browser: the local API and API keys
Screens of the current build with demo data, not a mock-up.

How do I connect Playwright to a profile?

  1. In Mirage open Automation, turn on the Local API and create a key for Scripts and SDK with See profiles and Start and stop profiles.
  2. Install the SDK and the Playwright version the app names.
  3. Run your script with the key in MIRAGE_API_KEY.
TypeScript
import { Mirage } from "@mirage-browser/sdk";

const mirage = new Mirage(); // reads MIRAGE_API_KEY and finds the app
const profile = await mirage.profiles.find("Client A");
const { browser, context } = await mirage.profiles.connect(profile!.id);
const page = context.pages()[0] ?? (await context.newPage());
await page.goto("https://example.com");
await browser.close(); // the script disconnects, the profile stays open

The same in Python:

Python
from playwright.sync_api import sync_playwright
from mirage_sdk import Mirage

mirage = Mirage()
profile = mirage.profiles.find("Client A")
with sync_playwright() as pw:
    session = mirage.profiles.connect(profile["id"], pw)
    page = session.context.new_page()
    page.goto("https://example.com")
    session.browser.close()

How do I make input look human?

TypeScript
import { humanize } from "@mirage-browser/sdk";

const human = humanize(page);
await human.click(page.getByRole("button", { name: "Sign in" }));
await human.type("me@example.com", page.getByLabel("Email"));
await human.scroll(800);

The cursor moves along a curved path at a person’s speed, clicks a random point near the middle of an element and types with longer pauses after words and punctuation. speed and seed tune it.

Can I keep my Puppeteer or Selenium scripts?

With Chrome profiles, yes. The start answer has a CDP address for Puppeteer and a debugger address for Selenium:

Python
from selenium import webdriver

endpoint = mirage.profiles.start(profile["id"], automation=True, debugger=True)["automation"]
options = webdriver.ChromeOptions()
options.debugger_address = endpoint["debuggerAddress"]
driver = webdriver.Chrome(options=options)
driver.get("https://example.com")

Firefox profiles take Playwright only. See browser cores.

What else can the SDK do?

Area Calls
Profiles list, iterate, find, create, update, delete, restore, start, stop, connect
Cookies importCookies, exportCookies in JSON, Netscape or Base64
Folders and tags folders.list, tags.list
Proxies list, create, import, check, changeIp, delete
Webhooks verifyWebhook checks a signature
Cloud MirageCloud works with cloud profiles while the app is closed

Is the Local API safe to leave on?

It listens on 127.0.0.1 only, so other computers and web pages cannot reach it. Each key has its own permissions and can be limited to chosen profiles. Revoke stops every script using a key at once.

What is the Playwright version rule?

A profile accepts one minor version of Playwright, the one the app shows. The SDK checks it before connecting, and mirage playwright install installs the right one.

Full reference: SDK guide and Local API reference. Scripts from Dolphin Anty can run almost unchanged, see import from other browsers.