keboola / oauth-v2-php-client
Keboola OAuth v2 API Client
6.0.0
2026-07-20 12:57 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.8
- keboola/php-api-client-base: ^1.1.1
- psr/http-message: ^1.0|^2.0
- psr/log: ^1.0|^2.0|^3.0
- webmozart/assert: ^1.11
Requires (Dev)
- ext-curl: *
- keboola/coding-standard: ^15.0
- phpstan/phpstan: ^1.10
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-webmozart-assert: ^1.2
- phpunit/phpunit: ^9.6
- sempro/phpunit-pretty-print: ^1.4
README
Keboola OAuth v2 API client, built on
keboola/php-api-client-base.
Installation
composer require keboola/oauth-v2-php-client
Usage
Both clients take the API base URL and the auth token first, followed by optional,
named transport options (logger, backoffMaxTries, connectTimeout,
requestTimeout, userAgent, requestHandler).
Credentials (Storage API token)
use Keboola\OAuthV2Api\Credentials; $credentials = new Credentials( 'https://oauth.keboola.com', getenv('STORAGE_API_TOKEN'), ); $list = $credentials->listCredentials('keboola.ex-google-drive');
Manager (application token)
use Keboola\OAuthV2Api\Manager; $manager = new Manager( 'https://oauth.keboola.com', getenv('APPLICATION_TOKEN'), ); $components = $manager->listComponents();
The application token is optional. When omitted (or null), the client authenticates
with the projected Kubernetes ServiceAccount token instead of X-KBC-ManageApiToken:
$manager = new Manager('https://oauth.keboola.com');
On a failed request both clients throw
Keboola\OAuthV2Api\Exception\ClientException (a subclass of
Keboola\ApiClientBase\Exception\ClientException), which exposes
getStatusCode() and getResponseBody() for the failing response when available.
Development
docker compose run dev composer install docker compose run dev composer ci
License
MIT licensed, see LICENSE file.