PHPackages                             sportmaster/api-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sportmaster/api-client

ActiveLibrary

sportmaster/api-client
======================

A flexible and extensible PHP client for the Sportmaster Seller API

02PHP

Since Jul 29Pushed 9mo agoCompare

[ Source](https://github.com/ilyalazarev31/sportmaster-api)[ Packagist](https://packagist.org/packages/sportmaster/api-client)[ RSS](/packages/sportmaster-api-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Sportmaster API Client
======================

[](#sportmaster-api-client)

A flexible and extensible PHP client for interacting with the Sportmaster Seller API. This package supports both native PHP and frameworks like Laravel, with easy configuration, token management, and logging.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require sportmaster/api-client
```

Usage
-----

[](#usage)

### Basic Example (Native PHP)

[](#basic-example-native-php)

```
use Sportmaster\Api\Client;
use Sportmaster\Api\Endpoints\AuthClient;
use Sportmaster\Api\Request\AuthRequest;

$client = new Client();
$authClient = new AuthClient($client);

$request = new AuthRequest('your_client_id', 'your_client_secret');
$response = $authClient->authenticate($request);

echo $response->getAccessToken(); // Outputs the access token
```

### Laravel Integration

[](#laravel-integration)

Add the service provider to `config/app.php`:

```
'providers' => [
    Sportmaster\Api\Laravel\SportmasterApiServiceProvider::class,
]
```

Use the client in your application:

```
use Sportmaster\Api\Endpoints\AuthClient;
use Sportmaster\Api\Request\AuthRequest;

$client = app(\Sportmaster\Api\Client::class);
$authClient = new AuthClient($client);

$request = new AuthRequest('your_client_id', 'your_client_secret');
$response = $authClient->authenticate($request);

echo $response->getAccessToken();
```

Configuration
-------------

[](#configuration)

- **Token Storage**: By default, tokens are stored in a JSON file (`.sportmaster_token.json`). You can implement `TokenStorageInterface` for custom storage.
- **Logger**: By default, logs are written to `sportmaster_api.log`. Implement `LoggerInterface` for custom logging.
- **HTTP Client**: Uses Guzzle by default. Pass a custom `ClientInterface` to the `Client` constructor for alternative HTTP clients.

Requirements
------------

[](#requirements)

- PHP ^8.1
- Guzzle HTTP Client ^7.5
- Monolog ^3.0

Testing
-------

[](#testing)

Run tests with PHPUnit:

```
composer test
```

Documentation
-------------

[](#documentation)

Detailed documentation for each class is available in the `docs/` directory.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance40

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef4c5a403c8407a15c56ee8d90dd44a74d2a3c0700ceae3a2113077bfffee5ac?d=identicon)[ilyalazarev31](/maintainers/ilyalazarev31)

### Embed Badge

![Health badge](/badges/sportmaster-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/sportmaster-api-client/health.svg)](https://phpackages.com/packages/sportmaster-api-client)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
