Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wesolowski committed Sep 24, 2019
1 parent 6bacca4 commit f5c9131
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,34 @@ This is a Wrapper for [Spotify Web API PHP](https://github.com/jwilsson/spotify-


## Requirements
* PHP 7.1 or later.
* PHP [cURL extension](http://php.net/manual/en/book.curl.php) (Usually included with PHP).
* PHP 7.2 or later.
* PHP [cURL extension](http://php.net/manual/en/book.curl.php) (Usually included with PHP).


## Start

Add ENV-Variable:

CLIENT_ID = ###my_client_id###
CLIENT_SECRET = ###my_client_secret###
REDIRECT_URI = ###my_redirect_uri###
REFRESH_TOKEN = ###my_refresh_token###

You can set the Env-Variable with this packages: [PHP dotenv](https://github.com/vlucas/phpdotenv) or [Symfony DotEnv](https://github.com/symfony/dotenv)
or manual in your application `$_ENV['CLIENT_ID']=CLIENT_ID`

#### Factory

Factory-Class `SpotifyApiConnectFactory` give you access to main function

First you should set `CLIENT_ID`, `CLIENT_SECRET`, `REDIRECT_URI` ENV-Variable.
REDIRECT_URI is you application URL

For Redirect-Url pleas use this class: `SpotifyApiConnect\Application\SpotifyWebApiPhp\Session`
-> Factory: `(new SpotifyApiConnectFactory)->createSpotifyApiAuth()`


Here is a Symfony example: <https://github.com/wesolowski/symfony-spotify-playlist-update/blob/master/src/Component/Token/Communication/Controller/Token.php>

When you get a Refresh Token pleas save this in `$_ENV['REFRESH_TOKEN']`

0 comments on commit f5c9131

Please sign in to comment.