PHPackages                             iammordaty/beatport-oauth-middleware - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. iammordaty/beatport-oauth-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

iammordaty/beatport-oauth-middleware
====================================

Guzzle 6.x OAuth middleware for Beatport API. Allows server-side querying and access token caching.

1.0.0.0(6y ago)1131MITPHPPHP &gt;=7.1CI failing

Since Nov 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/iammordaty/beatport-oauth-middleware)[ Packagist](https://packagist.org/packages/iammordaty/beatport-oauth-middleware)[ RSS](/packages/iammordaty-beatport-oauth-middleware/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (2)Used By (0)

beatport-oauth-middleware
=========================

[](#beatport-oauth-middleware)

Guzzle 6.x OAuth middleware for [Beatport](http://beatport.com) API. Allows server-side querying and access token caching.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Requirements](#requirements)
- [Usage](#usage)
- [Tests](#tests)
- [Further information](#further-information)
- [License](#license)

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

[](#installation)

The easiest way to install this middleware is via [composer](https://getcomposer.org):

```
$ composer require iammordaty/beatport-oauth-middleware
```

### Requirements

[](#requirements)

- PHP 7.1+
- Beatport's Consumer Key, Consumer Secret and account credentials

For more information about Consumer Key, Consumer Secret see [Beatport announcement](https://groups.google.com/forum/#!topic/beatport-api/sU8TCHEOpuY)and visit [Beatport API documentation](https://oauth-api.beatport.com/).

### Usage

[](#usage)

The following example demonstrates how to initialize a Guzzle client with middleware, and then retrieve information from Beatport API about the track based on its ID.

```
use BeatportOauth\AccessTokenProvider;
use BeatportOauth\OauthMiddlewareFactory;
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;

$oauthParams = [
   'consumer_key' => $_ENV['consumer_key'],
   'consumer_secret' => $_ENV['consumer_secret'],
   'username' => $_ENV['username'],
   'password' => $_ENV['password'],
];

$middleware = OauthMiddlewareFactory::create($oauthParams);

$stack = HandlerStack::create();
$stack->push($middleware);

$client = new Client([
    'auth' => 'oauth',
    'base_uri' => AccessTokenProvider::BASE_URI,
    'handler' => $stack,
]);

$response = $client->get('catalog/3/tracks', [
    'query' => [ 'id' => 12387959 ],
]);

$contents = json_decode($response->getBody()->getContents(), true);
```

In addition, it is also possible to cache access token for later use.

```
use BeatportOauth\OauthMiddlewareFactory;
use Cache\Adapter\PHPArray\ArrayCachePool;
use GuzzleHttp\HandlerStack;

$oauthParams = [/* */];
$cache = new ArrayCachePool(); // or any other PSR-16 compatible cache pool
$cacheConfig = [ 'key' => 'my-access-token-info' ]; // optional

$middleware = OauthMiddlewareFactory::createWithCachedToken(
    $oauthParams,
    $cache,
    $cacheConfig
);

$stack = HandlerStack::create();
$stack->push($middleware);
```

Tests
-----

[](#tests)

Copy `phpunit.xml.dist` file to `phpunit.xml` and fill in the missing parameters. Now you can test middleware by running the following command:

```
$ ./vendor/bin/phpunit
```

Further information
-------------------

[](#further-information)

- [Beatport API documentation](https://oauth-api.beatport.com)
- [Beatport announcement](https://groups.google.com/forum/#!topic/beatport-api/sU8TCHEOpuY) of API key acquisition

License
-------

[](#license)

iammordaty/beatport-oauth-middleware is licensed under the MIT License.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2356d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13261799?v=4)[iammordaty](/maintainers/iammordaty)[@iammordaty](https://github.com/iammordaty)

---

Top Contributors

[![iammordaty](https://avatars.githubusercontent.com/u/13261799?v=4)](https://github.com/iammordaty "iammordaty (5 commits)")

---

Tags

apibeatportguzzleguzzle-middlewareguzzle-php-libraryguzzlehttplibrarymiddlewaremiddlewareapiGuzzleguzzlehttplibraryoauthbeatport

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/iammordaty-beatport-oauth-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/iammordaty-beatport-oauth-middleware/health.svg)](https://phpackages.com/packages/iammordaty-beatport-oauth-middleware)
```

###  Alternatives

[eljam/guzzle-jwt-middleware

A jwt authentication middleware for guzzle 6

28722.5k3](/packages/eljam-guzzle-jwt-middleware)[brightfish/caching-guzzle

Cache HTTP responses through Guzzle middleware

1031.5k](/packages/brightfish-caching-guzzle)

PHPackages © 2026

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