All skills
Skillintermediate

Configuration & Setup

```bash npm install @cloudflare/puppeteer # or @cloudflare/playwright ```

Claude Code Knowledge Pack7/10/2026

Overview

Configuration & Setup

Installation

npm install @cloudflare/puppeteer  # or @cloudflare/playwright

Use Cloudflare packages - standard puppeteer/playwright won't work in Workers.

wrangler.json

{
  "name": "browser-worker",
  "main": "src/index.ts",
  "compatibility_date": "2025-01-01",
  "compatibility_flags": ["nodejs_compat"],
  "browser": {
    "binding": "MYBROWSER"
  }
}

Required: nodejs_compat flag and browser.binding.

TypeScript

interface Env {
  MYBROWSER: Fetcher;
}

  async fetch(request: Request, env: Env): Promise {
    // ...
  }
} satisfies ExportedHandler;

Development

wrangler dev --remote  # --remote required for browser binding

Local mode does NOT support Browser Rendering - must use --remote.

REST API

No wrangler config needed. Get API token with "Browser Rendering - Edit" permission.

curl -X POST \\
  'https://api.cloudflare.com/client/v4/accounts/{accountId}/browser-rendering/screenshot' \\
  -H 'Authorization: Bearer TOKEN' \\
  -d '{"url": "https://example.com"}' --output screenshot.png

Requirements

RequirementValue
Node.js compatibilitynodejs_compat flag
Compatibility date2023-03-01+
Module formatES modules only
BrowserChromium 119+ (no Firefox/Safari)

Not supported: WebGL, WebRTC, extensions, file:// protocol, Service Worker syntax.

Troubleshooting

ErrorSolution
MYBROWSER is undefinedUse wrangler dev --remote
nodejs_compat not enabledAdd to compatibility_flags
Module not foundnpm install @cloudflare/puppeteer
Browser Rendering not availableEnable in dashboard