mandisma / spotify-api-client
Http Client for the Spotify API.
0.2.1
2021-07-24 13:48 UTC
Requires
- php: ^7.3|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- phpmetrics/phpmetrics: ^2.7
- phpstan/phpstan: ^0.12.19
- phpunit/phpunit: ^9.3.3
- squizlabs/php_codesniffer: ^3.5.8
README
PHP Wrapper for the Spotify Api.
The library follow the structure from the Spotify Web Api Reference : https://developer.spotify.com/documentation/web-api/reference/#/
Installation
You can install the package via composer:
composer require mandisma/spotify-api-client
Usage
The OAuth2 authentication is not provided by this library. You have to do it or your own or use an existing library.
Then you have to create a class which implements the AuthorizationInterface
before you can start.
This interface is needed to initialize the client.
Initialize the client :
$clientBuilder = new \Mandisma\SpotifyApiClient\ClientBuilder(); $client = $clientBuilder->build(/*AuthorizationInterface*/ $authorization); $playedTracks = $client->playerApi->getRecentlyPlayedTracks();
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.