MLX · Puppeteer
Puppeteer Automation Example
Minimal pattern to start a Multilogin profile and attach Puppeteer over Chrome DevTools Protocol.
Prerequisites
- Multilogin agent running locally (default API port often
35000) - Valid token +
workspace_id(runbook) - Node.js +
puppeteer-core(not full Puppeteer download if you attach to MLX Chrome)
Flow
- Authenticate to the local MLX API.
- Start profile with automation enabled.
- Read the CDP endpoint from the start response.
puppeteer.connectto that browser.- Run your task; stop the profile in
finally.
Example (illustrative)
import puppeteer from "puppeteer-core";
// 1) Call MLX API to start profile with automation=true
// 2) Read websocket / CDP URL from response
const wsEndpoint = process.env.MLX_CDP_URL;
const browser = await puppeteer.connect({
browserWSEndpoint: wsEndpoint,
defaultViewport: null,
});
try {
const pages = await browser.pages();
const page = pages[0] || (await browser.newPage());
await page.goto("https://example.com", { waitUntil: "domcontentloaded" });
console.log(await page.title());
} finally {
await browser.disconnect();
// 3) Stop profile via MLX API
}
Exact start/stop routes follow your Multilogin X API version—treat the snippet as the attach pattern, not a vendor SDK dump.
Guardrails
- Always stop profiles after jobs to avoid Minutes / resource bleed.
- Do not hardcode tokens in repos.
- Cap navigation timeouts; record
trace_idper job. - Re-run fingerprint checks after major browser core updates.
See also the Selenium automation example and script runner hub.