Download the PHP package virtuallast/surfsight-php-client without Composer
On this page you can find all versions of the php package virtuallast/surfsight-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download virtuallast/surfsight-php-client
More information about virtuallast/surfsight-php-client
Files in virtuallast/surfsight-php-client
Package surfsight-php-client
Short Description A strongly typed PHP client for the Surfsight API.
License MIT
Homepage https://github.com/VirtualLast/surfsight-php-client
Informations about the package surfsight-php-client
Surfsight PHP Client
A strongly typed, framework-independent PHP 8.3+ client for the official Surfsight API.
Jane generates endpoint and model code from the committed OpenAPI specification. A small maintained API provides regional configuration, authentication, stable resource groups, pagination, media downloads, PSR dependency discovery, and package exceptions.
Features
- Official Surfsight API 2.0.0 models and all 129 specification paths
- PSR-18, PSR-17, and PSR-7 compatibility
- Automatic HTTP implementation discovery or explicit dependency injection
- Credential authentication, 24-hour token reuse, and one controlled re-authentication after HTTP 401
- Explicit Europe or North America selection
- Lazy offset pagination for device events
- Streaming media downloads without forwarding Surfsight credentials to media hosts
- No Symfony FrameworkBundle dependency
Installation
Quick start
Region::Europe uses https://api.de.surfsight.net/v2; Region::NorthAmerica uses https://api-prod.surfsight.net/v2. A region is always required.
Authentication
The client calls the documented POST /authenticate operation on first use, reuses the returned token for its documented 24-hour user-token lifetime, and adds Authorization: Bearer … to API calls. An HTTP 401 invalidates the token and permits exactly one re-authentication and retry.
Authentication failures throw AuthenticationException. Passwords and tokens are redacted from debug output and are never included in package exception messages.
Dependency injection
When omitted, php-http/discovery locates the implementations.
Events and pagination
The iterator follows the API's limit/offset metadata lazily and rejects repeated offsets.
Event media
Media links are temporary. Downloads require a valid HTTPS URL and return a PSR-7 stream. The Surfsight bearer token is never attached to the returned external URL.
Recording ranges
API coverage
Maintained high-level APIs currently cover authentication, device retrieval/update, device events/details, event file links/downloads, and recording ranges.
Every other generated operation remains deliberately available through $client->generated(), including alarms, audit logs, calibration, device operations, drivers, geofences, groups, health, OAuth, organizations, partners, streaming, telemetry, users, virtual events, webhooks, and organization albums. This low-level surface follows upstream naming and is less stable.
Errors
ConfigurationExceptionreports invalid local configuration.AuthenticationExceptionreports safe authentication failures.ApiExceptioncarries the operation, HTTP status, headers, safe decoded details, and previous generated exception.TransportExceptionwraps PSR transport failures.
No general-purpose retry policy is applied. Configure retries in the injected transport if desired.
Specification and generation
The original official specification is committed at openapi/surfsight.yaml (JSON syntax, which is valid YAML). Generated files live only in generated/ and must never be edited.
The update command downloads the official portal's page-data representation, validates its identity, and atomically replaces the file. Generation applies one documented temporary preprocessing fix; the committed upstream file is unchanged.
Current limitations
Only the priority resource groups have polished wrappers in this initial release. Other API groups use generated() until maintained wrappers are added. No live integration tests run by default, and no claim is made here that requests have been verified with real Surfsight credentials.
License
MIT
All versions of surfsight-php-client with dependencies
ext-json Version *
jane-php/open-api-runtime Version ^7.0
php-http/client-common Version ^2.7
php-http/discovery Version ^1.20
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
symfony/serializer Version ^7.4 || ^8.0