revenexx / sdk
Revenexx PHP SDK.
Requires
- php: >=8.0.0
- ext-curl: *
- ext-json: *
Requires (Dev)
- mockery/mockery: 1.6.12
- phpunit/phpunit: ^10
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This repository is auto-generated by the Revenexx SDK Generator. Do not submit changes directly — they will be overwritten on the next generation run.
Revenexx PHP SDK
Revenexx PHP SDK for server-side applications.
Installation
Install the SDK with Composer:
composer require revenexx/sdk
Getting Started
Init your SDK
Initialize your SDK with your Revenexx API endpoint, your tenant slug and your secret API key.
use Revenexx\Client; $client = (new Client()) ->setEndpoint('https://api.revenexx.com') // Your API Endpoint, all paths are versioned (/v1/...) ->setTenant('<TENANT_SLUG>') // Your tenant slug ->setApiKeyAuth('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ;
Acting on behalf of a signed-in user instead? Pass their bearer token as issued by the identity
provider — the SDK sends it unchanged in the Authorization header:
$client = (new Client()) ->setEndpoint('https://api.revenexx.com') ->setTenant('<TENANT_SLUG>') ->setBearerAuth('<USER_JWT>') // "Bearer " prefix optional ;
Make Your First Request
Once your SDK object is set, create any of the Revenexx service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section.
$products = new Products($client); $result = $products->productsList();
Full Example
use Revenexx\Client; use Revenexx\Services\Products; $client = (new Client()) ->setEndpoint('https://api.revenexx.com') // Your API Endpoint, all paths are versioned (/v1/...) ->setTenant('<TENANT_SLUG>') // Your tenant slug ->setApiKeyAuth('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $products = new Products($client); $result = $products->productsList(); $product = $products->productsGet( id: '<PRODUCT_ID>' );
Error Handling
The Revenexx PHP SDK raises a RevenexxException with message, code and response properties. You can handle any errors by catching RevenexxException and present the message to the user or handle it yourself based on the provided error information. Below is an example.
use Revenexx\RevenexxException; $products = new Products($client); try { $product = $products->productsGet( id: '<PRODUCT_ID>' ); } catch (RevenexxException $error) { echo $error->getMessage(); }
Learn more
You can use the following resources to learn more and get help
Sample
See a runnable example for this SDK in the samples repo.
Contribution
This library is auto-generated by the Revenexx custom SDK Generator. To learn more about how you can help us improve this SDK, please check the contribution guide before sending a pull-request.
License
Please see the MIT license file for more information.