keboola/oauth-v2-php-client

Keboola OAuth v2 API Client

Maintainers

Package info

github.com/keboola/oauth-v2-php-client

pkg:composer/keboola/oauth-v2-php-client

Transparency log

Statistics

Installs: 24 307

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

6.0.0 2026-07-20 12:57 UTC

This package is auto-updated.

Last update: 2026-07-20 13:00:07 UTC


README

GitHub Actions

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.