Skip to content

tnapf/Spotify

Repository files navigation

Tnapf/Spotify

A proper Spotify API client for PHP (still in development)

Installation

composer require tnapf/spotify

Usage

Creating a new Spotify object

use Tnapf\Spotify\Client;
use Psr\Http\Client\ClientInterface;

$httpClient = ClientInterface::class; // <- must be a client interface implementation

$spotify = new Client($httpClient, $clientId, $clientSecret);

Making requests

/** @var Album */
$spotify->albums->get('0rGKEhiSyEwmcpQoU5Gg61');

Since everything will eventually be mapped you'll get autocomplete from your IDE so you don't have to look up the documentation all the time.