caxy/badgekit-client

Client for Mozilla BadgeKit API

dev-master / 1.0.x-dev 2016-05-12 02:26 UTC

This package is auto-updated.

Last update: 2024-11-22 07:03:31 UTC


README

Latest Version on Packagist Software License Total Downloads

Here is a PHP client for Mozilla's BadgeKit API.

Install

Via Composer

$ composer require caxy/badgekit-client

Usage

$client = new GuzzleHttp\Client([
  'base_uri' => 'https://badgekit.example.com'
]);
$middleware = new Caxy\BadgeKit\JwtMiddleware('MASTER_SECRET_FROM_BADGEKIT');

$stack = $client->getConfig('handler');
$stack->push(GuzzleHttp\Middleware::mapRequest($middleware));

$serviceClient = new Caxy\BadgeKit\ServiceClient($client);
$command = $serviceClient->getCommand('get_reviews', [
  'system' => 'example',
  'application' => '235f684c5e5f88f1575434403adc2562',
  'badge' => 'a-groovy-badge',
]);
$result = $serviceClient->execute($command);

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email bdoherty@caxy.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.