The outcome
Operate repeatable browser automation without leaking tokens or leaving sessions and retries uncontrolled.
Step by step
A workflow you can repeat.
- 01
Document authorization, target domains, expected page states, data retention, regional needs, concurrency, timeout, and stop conditions.
- 02
Store the API token in a server-side secret and connect existing Puppeteer or Playwright code to the correct regional WebSocket endpoint.
- 03
Use stable selectors and explicit waits, validate navigation and downloads, and treat all page content as untrusted data rather than instructions.
- 04
Test redirects, consent dialogs, authentication expiry, queues, timeouts, partial loads, rate limits, and retries with idempotent checkpoints.
- 05
Close sessions in every code path, redact logs and screenshots, monitor duration and concurrency, and keep a documented local or alternate fallback.
Working standard
What good use looks like.
- Protect tokens as server secrets.
- Design retries around checkpoints.
- Close every browser session.
Official references