Skip to content

docs: fix CDP endpoint authentication documentation#134

Open
yavzius wants to merge 1 commit intocloudflare:mainfrom
yavzius:docs/fix-cdp-authentication-docs
Open

docs: fix CDP endpoint authentication documentation#134
yavzius wants to merge 1 commit intocloudflare:mainfrom
yavzius:docs/fix-cdp-authentication-docs

Conversation

@yavzius
Copy link

@yavzius yavzius commented Feb 2, 2026

Summary

The CDP documentation contains two inaccuracies:

  1. Authentication method: States endpoints require CDP_SECRET header, but the implementation uses a query parameter
  2. WebSocket path: Lists WS /cdp/devtools/browser/{id} but the actual endpoint is WS /cdp

Evidence

Actual implementation (src/routes/cdp.ts:155-157):

const url = new URL(c.req.url);
const providedSecret = url.searchParams.get('secret');  // query param, not header

Code comments confirm (src/routes/cdp.ts:11):

* Authentication: Pass secret as query param `?secret=<secret>` on WebSocket connect.

Bundled scripts use query params (skills/cloudflare-browser/scripts/cdp-client.js:25):

const wsUrl = `wss://${workerUrl}/cdp?secret=${encodeURIComponent(CDP_SECRET)}`;

Changes

  • Updated endpoint table to show query parameter syntax
  • Corrected WebSocket path from /cdp/devtools/browser/{id} to /cdp
  • Changed "header" to "query parameter" in authentication note

The documentation incorrectly stated that CDP_SECRET is passed as a
header. The actual implementation uses a query parameter (?secret=<value>),
as shown in src/routes/cdp.ts and the bundled skill scripts.

Also corrects the WebSocket endpoint path from /cdp/devtools/browser/{id}
to the actual /cdp path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant