PHPackages                             sitescreen/siterenderer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sitescreen/siterenderer

ActiveLibrary[API Development](/categories/api)

sitescreen/siterenderer
=======================

Official PHP SDK for the SiteScreen website screening and rendering API

v2.2.0(yesterday)050MITPHPPHP ^8.2

Since Jun 28Pushed 4mo agoCompare

[ Source](https://github.com/SiteScreen/siterenderer-sdk)[ Packagist](https://packagist.org/packages/sitescreen/siterenderer)[ Docs](https://sitescreen.io)[ RSS](/packages/sitescreen-siterenderer/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (4)Used By (0)

sitescreen/siterenderer
=======================

[](#sitescreensiterenderer)

PHP SDK for the current SiteScreen public API.

Installation
------------

[](#installation)

```
composer require sitescreen/siterenderer:^2.0
```

The current SDK line targets `api.sitescreen.io`. It is not API-compatible with the earlier 1.x API.

The SDK targets the public SiteScreen HTTP API:

- `GET /health`
- `GET /v1/me`
- `GET /v1/render/presets`
- `POST /v1/screen`
- `POST /v1/screen/wait`
- `GET /v1/jobs/{jobId}`
- `GET /v1/reports/{jobId}`
- `POST /v1/render/url`
- `POST /v1/render/url/wait`
- `POST /v1/render/html`
- `POST /v1/render/html/wait`
- `GET /v1/render/jobs/{jobId}`

Authentication uses only:

```
Authorization: Bearer

```

`X-Api-Key` is not supported by the current API.

Target URLs and `baseUrl` values must use `http` or `https`, include a host, and must not contain URL credentials.

Screening
---------

[](#screening)

```
use SiteScreen\SiteRenderer\DTO\ScreenUrlWaitRequest;
use SiteScreen\SiteRenderer\DTO\ScreeningLimits;
use SiteScreen\SiteRenderer\SiteScreenClient;

$client = new SiteScreenClient(
    apiKey: getenv('SITESCREEN_API_KEY'),
    apiBaseUrl: 'https://api.sitescreen.io'
);

$result = $client->screenUrlAndWait(new ScreenUrlWaitRequest(
    url: 'https://example.com',
    profile: 'desktop-chromium',
    browser: true,
    screenshot: true,
    ai: true,
    limits: new ScreeningLimits(timeoutMs: 45_000, maxRedirects: 12, maxTextChars: 30_000),
    maxWaitMs: 180_000
));

$job = $result->completed ? $result->job : $client->getScreeningJob($result->jobId);
$report = $job?->report;
```

For async flow:

```
$accepted = $client->screenUrl(new ScreenUrlRequest(url: 'https://example.com'));
$job = $client->getScreeningJob($accepted->jobId);
```

Completed screening reports contain raw arrays for `ruleVerdict`, `probe`, `browser`, `ai`, and `telemetry`. Keeping the report raw is deliberate while the screening schema is still evolving.

The AI verdict is also available through typed helpers:

```
$ai = $job?->aiVerdict();
$classification = $job?->aiClassification();

echo $ai?->summary . PHP_EOL;
echo $classification?->siteType . PHP_EOL;
echo $classification?->primaryTopic . PHP_EOL;
echo $classification?->contentLanguage . PHP_EOL;
```

`AiClassification` exposes grouping-friendly axes such as `accessState`, `siteType`, `primaryTopic`, `secondaryTopics`, `businessModel`, `audience`, `geoScope`, `contentLanguage`, `safetyRisk`, `sensitiveFlags`, and `normalizedTags`.

URL Rendering
-------------

[](#url-rendering)

```
use SiteScreen\SiteRenderer\DTO\ContentType;
use SiteScreen\SiteRenderer\DTO\RenderLimits;
use SiteScreen\SiteRenderer\DTO\RenderMode;
use SiteScreen\SiteRenderer\DTO\RenderUrlWaitRequest;

$wait = $client->renderUrlAndWait(new RenderUrlWaitRequest(
    url: 'https://example.com',
    fullPage: true,
    profile: 'desktop-chromium',
    contentType: ContentType::PNG,
    renderMode: RenderMode::PAGE,
    limits: new RenderLimits(timeoutMs: 60_000, maxFullPageHeightPx: 20_000),
    maxWaitMs: 180_000
));

$job = $wait->completed ? $wait->job : $client->getRenderJob($wait->jobId);
$artifactUrl = $job?->result?->artifactUrl();
```

Supported URL render outputs in the current API version:

- viewport PNG: `contentType=png`, `fullPage=false`, `renderMode=page`;
- full-page PNG: `contentType=png`, `fullPage=true`, `renderMode=page`;
- full-page JPEG: `contentType=jpg`, `fullPage=true`, `renderMode=page`;
- page PDF: `contentType=pdf`, `renderMode=page`;
- document-style PDF: `contentType=pdf`, `renderMode=document`.

Document-style PDF supports header/footer templates, grayscale mode, text PDF mode, A4-oriented PDF options, and printer-like high-contrast background lightening.

Current document-mode limitations:

- `DocumentPdfMode::IMAGE` / `pdf:image` is intentionally exposed as a future SDK option but throws `NotImplementedYetException` until the API supports it.
- `DocumentSignatureBlockOptions` validates prepared PNG/JPEG `data:image`payloads, but using it in `DocumentOptions` throws `NotImplementedYetException`until signature/seal rendering is available in the API.

HTML Rendering
--------------

[](#html-rendering)

Raw HTML rendering uses the same render result schema and artifact handling as URL rendering. `baseUrl` is optional and is used by the browser layer to resolve relative CSS, image, font, and link URLs.

```
use SiteScreen\SiteRenderer\DTO\ContentType;
use SiteScreen\SiteRenderer\DTO\RenderHtmlWaitRequest;
use SiteScreen\SiteRenderer\DTO\RenderLimits;
use SiteScreen\SiteRenderer\DTO\RenderMode;

$wait = $client->renderHtmlAndWait(new RenderHtmlWaitRequest(
    html: 'Invoice',
    fullPage: true,
    profile: 'desktop-chromium',
    contentType: ContentType::PNG,
    renderMode: RenderMode::PAGE,
    limits: new RenderLimits(timeoutMs: 60_000, maxFullPageHeightPx: 20_000),
    baseUrl: 'https://example.com/',
    maxWaitMs: 180_000
));

$job = $wait->completed ? $wait->job : $client->getRenderJob($wait->jobId);
$artifactUrl = $job?->result?->artifactUrl();
```

HTML input is currently limited by the public API to `2 MiB` before JSON overhead. Larger HTML documents should be published as URLs or split into a future upload-based render flow.

Artifacts
---------

[](#artifacts)

Render results and screening screenshots usually expose a CDN-facing artifact alias:

```
$downloaded = $client->downloadFile($artifactUrl);
$downloaded->saveToPath(__DIR__ . '/output/' . $downloaded->fileName);
```

Artifact URLs have the form:

```
https://cdn.sitescreen.io/a//.

```

Provider-specific object storage URLs are implementation details and should not be stored as the public artifact contract.

If remote artifact storage is unavailable and inline fallback is enabled, render results may contain `artifactBase64` instead of `artifact.url`.

The `/files/` endpoint is not part of the 2.x SDK surface. Pass the full artifact URL returned by the API.

Not Implemented Yet
-------------------

[](#not-implemented-yet)

The following SDK surface is intentionally present but throws `NotImplementedYetException` until the API supports it:

- document `pdf:image` rasterized PDF mode;
- document signature/seal block options.

Development
-----------

[](#development)

Do not run PHP or Composer directly on the host. Use a container:

```
docker run --rm -v "$PWD":/app -w /app composer:2 composer validate --no-check-publish
docker run --rm -v "$PWD":/app -w /app php:8.3-cli sh -lc 'find src tests -name "*.php" -print0 | xargs -0 -n1 php -l'
```

For the full dev check, install dependencies inside a temporary container copy so `vendor/` and `composer.lock` are not written into the library repo:

```
docker run --rm -v "$PWD":/src -w /tmp composer:2 sh -lc 'mkdir -p /app && cp -a /src/. /app && cd /app && composer install && composer test && composer analyse'
```

License
-------

[](#license)

The SiteScreen PHP SDK is released under the MIT License.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance52

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a547d38575477bc0970d3fe20d4e183db481722076db01cc3cd404ec433b683a?d=identicon)[SiteScreen](/maintainers/SiteScreen)

---

Top Contributors

[![sitescreen-dev](https://avatars.githubusercontent.com/u/263206989?v=4)](https://github.com/sitescreen-dev "sitescreen-dev (1 commits)")

---

Tags

screenshotsBrowser automationsitescreenwebsite-screeninghtml-renderingpdf-renderingai-classification

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sitescreen-siterenderer/health.svg)

```
[![Health](https://phpackages.com/badges/sitescreen-siterenderer/health.svg)](https://phpackages.com/packages/sitescreen-siterenderer)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M981](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
