From 9c5e009f7cafac75410c5e5200b70b54a4d81268 Mon Sep 17 00:00:00 2001 From: Techulus Agent Date: Wed, 17 Jun 2026 23:11:53 +1000 Subject: [PATCH] Document CDP session support --- README.md | 22 ++++++++++++++++++++++ src/CaptureSessions.php | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e1fe95..032cbed 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,28 @@ $screenshot = $client->sessions()->action($sessionId, 'screenshot', ['fullPage' $client->sessions()->close($sessionId); ``` +### CDP Sessions + +To create a session with a Chrome DevTools Protocol (CDP) connection, pass +`['cdp' => true]` when creating the browser session. The response includes a +connection URL on the returned session object: + +```php +$created = $client->sessions()->create([ + 'maxTtlSeconds' => 300, + 'cdp' => true, +]); + +$session = $created['session']; +$connectUrl = $session['connectUrl']; + +echo $connectUrl; + +$client->sessions()->close($session['id']); +``` + +CDP sessions cannot be combined with `proxy` or `bypassBotDetection` options. + ## Configuration Options ### Constructor Options diff --git a/src/CaptureSessions.php b/src/CaptureSessions.php index cbc5971..b08db55 100644 --- a/src/CaptureSessions.php +++ b/src/CaptureSessions.php @@ -16,7 +16,8 @@ public function __construct( } /** - * @param array $options + * @param array $options Browser session options, + * for example ['maxTtlSeconds' => 300, 'cdp' => true]. * @return array */ public function create(array $options = []): array