apiera / php-sdk
Apiera PHP SDK composer library.
2.0.0
2025-03-15 21:29 UTC
Requires
- php: ^8.3
- auth0/auth0-php: ^8.13
- guzzlehttp/guzzle: ^7.0
- nyholm/psr7: ^1.8
- psr/cache: ^3.0
- psr/http-message: ^2.0
- symfony/uid: ^7.2
Requires (Dev)
- apiera/php-standards: ^1.0
- dg/bypass-finals: ^1.9
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- squizlabs/php_codesniffer: ^3.11
This package is auto-updated.
Last update: 2025-04-16 19:43:11 UTC
README
A PHP SDK for interacting with the Apiera API. Built with PHP 8.3, utilizing PSR standards and Guzzle HTTP client.
Requirements
- PHP 8.3 or higher
- Composer
Package dependencies will be installed automatically via Composer.
Installation
Install via Composer:
composer require apiera/php-sdk
Configuration Options
The SDK can be configured with the following options:
$apieraConfig = new \Apiera\Sdk\Configuration( baseUrl: 'https://api.example.com', // The base URL of the API userAgent: 'MyAppName/1.0', // Replace with your application user agent oauthDomain: 'your-oauth-domain.com', // OAuth2 authentication domain oauthClientId: 'your-oauth-client-id', // OAuth2 client ID oauthClientSecret: 'your-oauth-client-secret', // OAuth2 client secret oauthCookieSecret: 'your-oauth-cookie-secret', // OAuth2 cookie secret oauthAudience: 'your-oauth-audience', // OAuth2 audience oauthOrganizationId: 'your-organization-id', // OAuth2 organization ID cache: $yourCacheInstance, // Pass a CacheItemPoolInterface object timeout: 15, // Optional: Request timeout (default: 10 seconds) debugMode: true, // Optional: Enable or disable debug mode (default: false) options: [], // Optional: Pass your custom Guzzle handlers or middlewares defaultIntegration: 'integration-iri', // Optional: Pass a default integration iri reference defaultInventoryLocation: 'inventory-location-iri', // Optional: Pass a default inventory location iri reference defaultStore: 'store-iri' // Optional: Pass a default store iri reference );
Using the SDK
ApieraSdk
is a centralized class providing access to all available API resources:
$apieraSdk = new \Apiera\Sdk\ApieraSdk($apieraConfig); $categoryRequest = new \Apiera\Sdk\DTO\Request\Category\CategoryRequest( name: 'Hardware', store: '/api/v1/stores/520413a8-509a-4048-96e6-81751e315c5d', description: 'Some category description', parent: '/api/v1/stores/520413a8-509a-4048-96e6-81751e315c5d/categories/520413a8-509a-4048-96e6-81751e315c5d2' ); $categoryResponse = $apieraSdk->category()->create($categoryRequest); // Do something with $categoryResponse
More examples can be found here
Support
For support, please contact fredrik.tveraaen@apiera.io or visit our documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details