cordova-spotify-oauth
Advanced tools
Comparing version 0.1.8 to 0.1.10
{ | ||
"name": "cordova-spotify-oauth", | ||
"version": "0.1.8", | ||
"version": "0.1.10", | ||
"description": "Cordova plugin for authenticating with Spotify", | ||
@@ -5,0 +5,0 @@ "main": "www/build/spotify-oauth.min.js", |
@@ -15,17 +15,7 @@ # Cordova Spotify OAuth Plugin | ||
## Installation | ||
## Examples | ||
```bash | ||
cordova plugin add cordova-spotify-oauth | ||
``` | ||
## Usage | ||
The plugin implements the [OAuth Authorization Code][auth-code-flow] flow for the Spotify API. This allows you to obtain access and refresh tokens for user related-actions (such as viewing and modifying their library, streaming tracks via the SDKs, etc.). Therefore, additional preparation in addition to installing the plugin is required. | ||
The plugin consists of two functions clobbered onto `cordova.plugins.spotifyAuth`. | ||
### Examples | ||
#### Log in | ||
### Log in | ||
```js | ||
@@ -37,3 +27,3 @@ const config = { | ||
tokenExchangeUrl: "<URL OF TOKEN EXCHANGE HTTP ENDPOINT>", | ||
tokenExchangeUrl: "<URL OF TOKEN REFRESH HTTP ENDPOINT>", | ||
tokenRefreshUrl: "<URL OF TOKEN REFRESH HTTP ENDPOINT>", | ||
}; | ||
@@ -48,3 +38,3 @@ | ||
#### Log out | ||
### Log out | ||
```js | ||
@@ -55,2 +45,12 @@ cordova.plugins.spotifyAuth.forget() | ||
## Installation | ||
```bash | ||
cordova plugin add cordova-spotify-oauth | ||
``` | ||
## Usage | ||
The plugin implements the [OAuth Authorization Code][auth-code-flow] flow for the Spotify API. This allows you to obtain access and refresh tokens for user related-actions (such as viewing and modifying their library, streaming tracks via the SDKs, etc.). Therefore, additional preparation in addition to installing the plugin is required. | ||
### Protocol registration | ||
@@ -73,2 +73,3 @@ | ||
To easily implement them, we built a [Serverless][serverless] service for [AWS Lambda][aws-lambda] over in the [`oauth-token-api`][token-api-example] folder. Make sure you [install the Serverless Framework properly][serverless-installation]! | ||
To resolve the project dependencies, please use [yarn][yarn-install] as shown below before deploying the service. | ||
@@ -88,2 +89,3 @@ For the execution of the functions to work you need to set some environmental configuration in the file `oauth-token-api/.env` | ||
cd oauth-token-api | ||
yarn install | ||
serverless deploy | ||
@@ -113,1 +115,2 @@ ``` | ||
[token-refresh-url]: https://festify.github.io/cordova-spotify-oauth/interfaces/config.html#tokenrefreshurl "OAuth Access Token Refresh URL" | ||
[yarn-install]: https://yarnpkg.com/en/docs/install "Yarn Install" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
317623
26
110