Download the PHP package apertur/sdk without Composer
On this page you can find all versions of the php package apertur/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sdk
apertur/sdk
Official PHP SDK for the Apertur API. Supports API key and OAuth token authentication, session management, image uploads (plain and encrypted), long polling, webhook verification, and full resource CRUD.
Installation
Requires PHP 8.1+ and is installed via Composer.
Quick Start
Create a client, open an upload session, and upload an image in a few lines. See the API documentation for a full overview.
Authentication
The client accepts either a long-lived API key or a short-lived OAuth bearer token. Only one is required; providing both will result in the API key being used. See Authentication documentation.
Sessions
Upload sessions scope every image upload. You can create a session with optional settings, retrieve it, protect it with a password, and check delivery status. See Sessions documentation.
Uploading Images
Upload a plain image using a file path or a PHP stream resource. For end-to-end encrypted uploads, use imageEncrypted with the server's RSA public key. See Upload documentation.
Long Polling
Poll a session for new images, download each one, and acknowledge receipt to advance the queue. The pollAndProcess helper loops automatically and calls your handler for every image. See Long Polling documentation.
Receiving Webhooks
Apertur signs every webhook payload so you can verify it was not tampered with. Three verification methods are available: verifySignature for image delivery webhooks, verifyEventSignature for HMAC-signed event webhooks, and verifySvixSignature for Svix-signed event webhooks. See Webhooks documentation.
Destinations
Destinations define where uploaded images are delivered (S3, webhook, long-poll queue, etc.). You can list, create, update, delete, and trigger a test delivery for any destination. See Destinations documentation.
API Keys
API keys are scoped to a project and optionally restricted to specific destinations. You can list, create, update, delete, and reassign destinations for any key. See API Keys documentation.
Event Webhooks
Event webhooks push real-time notifications to your endpoint for events such as image uploads and session state changes. You can manage webhooks, inspect delivery history, and retry failed deliveries. See Event Webhooks documentation.
Encryption
Apertur supports end-to-end encrypted uploads using RSA-OAEP + AES-256-GCM. Fetch the server's RSA public key, then pass it to upload->imageEncrypted. The Crypto class handles key wrapping and encryption automatically. See Encryption documentation.
Error Handling
All API errors throw typed exceptions that extend AperturException. Catch the specific subclass you care about, or catch AperturException as a fallback for any API error. See Error Handling documentation.
API Reference
Full API reference, guides, and changelog are available at docs.apertur.ca.
License
This package is open-source software licensed under the MIT license.