Types
The PHP SDK exposes the types below. Import any of them with use:
use PoliPage\PoliPage;use PoliPage\ProjectModeInput;use PoliPage\DocumentDescriptor;PoliPage
Section titled “PoliPage”Poli Page SDK client — entry point for the namespaced render API.
Render
Section titled “Render”The render namespace exposed as $client->render. Phases 2 + 3 cover the four render operations; Phase 4 adds Documents.
Documents
Section titled “Documents”The documents namespace exposed as $client->documents. Hosts the four stored-document operations per spec v1.3 §6.
RenderInput
Section titled “RenderInput”Sealed-in-package base for render inputs. The SDK exposes only two concrete subclasses (, ); external code cannot subclass this directly because the constructor is protected and both children are final.
ProjectModeInput
Section titled “ProjectModeInput”Render against a stored project + template. Used by render->pdf, render->pdfStream, render->document, and render->preview.
InlineModeInput
Section titled “InlineModeInput”Render with raw HTML inline (no project / template resolution). Accepted only by render->preview; the document-producing methods require project mode (enforced both at the type-hint level and at runtime).
PreviewResult
Section titled “PreviewResult”Result of client->render->preview($input). Wire shape produced by POST /v1/render/preview — paginated HTML preview output. The totalPages field on this DTO is distinct from pageCount on (added in Phase 4) — see sdk-node 8523e13.
DocumentDescriptor
Section titled “DocumentDescriptor”Stored document returned by $client->render->document(...). Mirrors the deployed API’s wire shape one-to-one. Nullable wire fields (project ids, template ids, version, etc.) map to ?string; metadata is always non-null (the server echoes {} when the caller omits it).
DocumentPreviewResult
Section titled “DocumentPreviewResult”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.
Thumbnail
Section titled “Thumbnail”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.
ThumbnailOptions
Section titled “ThumbnailOptions”Options for $client->documents->thumbnails($id, $options). Spec §6.3.
RenderMetadata
Section titled “RenderMetadata”Free-form caller metadata forwarded to the API and echoed back on preview and document responses. 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).
RetryEvent
Section titled “RetryEvent”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.