Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.1.0"
".": "1.2.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 25
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2460611c25145e2ca049b14c32be0f9ac9f4ded0b95154d29a83b4a6c1453f3e.yml
openapi_spec_hash: ab3a6473e575381cacd245bf54dcf0f7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4903d5902cec6a80f42b9adaa9cf0defa9805ff22d7ae96970d209a4f867e195.yml
openapi_spec_hash: 1097891c23530dfe0155f23170daf973
config_hash: c7b0cdaba3b9797b77efd89e1754d803
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.2.0 (2026-06-25)

Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.1.0...v1.2.0)

### Features

* **api:** api update ([e984607](https://github.com/context-dot-dev/context-php-sdk/commit/e984607de54b77c8cd7991636bc1c5d95ca42e1e))

## 1.1.0 (2026-06-22)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.0.0...v1.1.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte
<!-- x-release-please-start-version -->

```
composer require "context-dev/context-dev-php 1.1.0"
composer require "context-dev/context-dev-php 1.2.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions src/ServiceContracts/WebContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public function extractStyleguide(
* @param HandleCookiePopup|value-of<HandleCookiePopup> $handleCookiePopup Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.
* @param int $maxAgeMs Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
* @param Page|value-of<Page> $page Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.
* @param int $scrollOffset Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
* @param int $timeoutMs Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
* @param Viewport|ViewportShape $viewport Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
* @param int $waitForMs Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.
Expand All @@ -153,6 +154,7 @@ public function screenshot(
HandleCookiePopup|string $handleCookiePopup = 'false',
int $maxAgeMs = 86400000,
Page|string|null $page = null,
?int $scrollOffset = null,
?int $timeoutMs = null,
Viewport|array $viewport = ['width' => 1920, 'height' => 1080],
int $waitForMs = 3000,
Expand Down
1 change: 1 addition & 0 deletions src/Services/WebRawService.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ public function extractStyleguide(
* handleCookiePopup?: HandleCookiePopup|value-of<HandleCookiePopup>,
* maxAgeMs?: int,
* page?: Page|value-of<Page>,
* scrollOffset?: int,
* timeoutMs?: int,
* viewport?: Viewport|ViewportShape,
* waitForMs?: int,
Expand Down
3 changes: 3 additions & 0 deletions src/Services/WebService.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ public function extractStyleguide(
* @param HandleCookiePopup|value-of<HandleCookiePopup> $handleCookiePopup Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.
* @param int $maxAgeMs Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
* @param Page|value-of<Page> $page Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.
* @param int $scrollOffset Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
* @param int $timeoutMs Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
* @param Viewport|ViewportShape $viewport Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
* @param int $waitForMs Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.
Expand All @@ -243,6 +244,7 @@ public function screenshot(
HandleCookiePopup|string $handleCookiePopup = 'false',
int $maxAgeMs = 86400000,
Page|string|null $page = null,
?int $scrollOffset = null,
?int $timeoutMs = null,
Viewport|array $viewport = ['width' => 1920, 'height' => 1080],
int $waitForMs = 3000,
Expand All @@ -256,6 +258,7 @@ public function screenshot(
'handleCookiePopup' => $handleCookiePopup,
'maxAgeMs' => $maxAgeMs,
'page' => $page,
'scrollOffset' => $scrollOffset,
'timeoutMs' => $timeoutMs,
'viewport' => $viewport,
'waitForMs' => $waitForMs,
Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
namespace ContextDev;

// x-release-please-start-version
const VERSION = '1.1.0';
const VERSION = '1.2.0';
// x-release-please-end
20 changes: 20 additions & 0 deletions src/Web/WebScreenshotParams.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* handleCookiePopup?: null|HandleCookiePopup|value-of<HandleCookiePopup>,
* maxAgeMs?: int|null,
* page?: null|Page|value-of<Page>,
* scrollOffset?: int|null,
* timeoutMs?: int|null,
* viewport?: null|Viewport|ViewportShape,
* waitForMs?: int|null,
Expand Down Expand Up @@ -80,6 +81,12 @@ final class WebScreenshotParams implements BaseModel
#[Optional(enum: Page::class)]
public ?string $page;

/**
* Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
*/
#[Optional]
public ?int $scrollOffset;

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down Expand Up @@ -120,6 +127,7 @@ public static function with(
HandleCookiePopup|string|null $handleCookiePopup = null,
?int $maxAgeMs = null,
Page|string|null $page = null,
?int $scrollOffset = null,
?int $timeoutMs = null,
Viewport|array|null $viewport = null,
?int $waitForMs = null,
Expand All @@ -132,6 +140,7 @@ public static function with(
null !== $handleCookiePopup && $self['handleCookiePopup'] = $handleCookiePopup;
null !== $maxAgeMs && $self['maxAgeMs'] = $maxAgeMs;
null !== $page && $self['page'] = $page;
null !== $scrollOffset && $self['scrollOffset'] = $scrollOffset;
null !== $timeoutMs && $self['timeoutMs'] = $timeoutMs;
null !== $viewport && $self['viewport'] = $viewport;
null !== $waitForMs && $self['waitForMs'] = $waitForMs;
Expand Down Expand Up @@ -213,6 +222,17 @@ public function withPage(Page|string $page): self
return $self;
}

/**
* Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
*/
public function withScrollOffset(int $scrollOffset): self
{
$self = clone $this;
$self['scrollOffset'] = $scrollOffset;

return $self;
}

/**
* Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
*/
Expand Down