Skip to content

Types

The PHP SDK exposes the types below. Import any of them with use:

use PoliPage\PoliPage;
use PoliPage\RenderInput;
use PoliPage\DocumentDescriptor;

Poli Page SDK client — entry point for the namespaced render API.

The render namespace exposed as $client->render: the three render operations, all POST /v1/render.

The documents namespace exposed as $client->documents. Hosts the four stored-document operations per spec v1.3 §6.

Render a stored project + template. Used by render->pdf, render->pdfStream, render->document, and renderToFile.

Stored document returned by $client->render->document(...). Mirrors the deployed API’s wire shape one-to-one. Nullable wire fields (project ids, template ids, etc.) map to ?string; metadata is always non-null (the server echoes {} when the caller omits it).

Result of $client->documents->preview($id). The deployed API responds with text/html directly (not a JSON envelope), exposing the page count via the X-Document-Page-Count response header.

A single page thumbnail returned by $client->documents->thumbnails(...). data is base64-encoded image bytes; decode with base64_decode before writing to disk or sending downstream. Spec §6.3.

Options for $client->documents->thumbnails($id, $options). Spec §6.3.

Free-form caller metadata forwarded to the API and echoed back on the document descriptor. Values are limited to primitives (string | int | float | bool) — nested arrays and objects are rejected at construction time to match the wire-contract guarantee (spec §5.4) and the Node SDK’s compile-time enforcement (types.ts:31).

Fired before each retry sleep — carries the upcoming attempt number, the sleep duration in milliseconds (spec convention is delayMs across all SDKs even though PHP internals use seconds), and the exception that caused the previous attempt to fail.

For the full set of fields on each class and the PoliPage\Exception\* hierarchy, see the source on GitHub.