spotify-device-authentication 0.0.2 • Public • Published 5 years ago spotify-device-authentication
To add a user to a spotify device you need stored credentials. To generate these authBlob
from username and password you need to connect to the spotify device api.
Example
Using callback:
const credentialGenerator = require ( ' spotify-device-authentication ' ) ;
credentialGenerator ( ' yourUserName ' , ' yourPassword ' , function ( err , val ) {
if ( err ) {
console . log ( err ) ;
} else {
console . log ( JSON . stringify ( val ) ) ;
}
} ) ;
Using Promise:
const credentialGenerator = require ( ' spotify-device-authentication ' ) ;
credentialGenerator ( ' yourUserName ' , ' yourPassword ' )
. then ( function ( val ) {
console . log ( JSON . stringify ( val ) ) ;
} )
. catch ( function ( err ) {
console . log ( err ) ;
} ) ;
Package Sidebar Install npm i spotify-device-authentication
Downloads Weekly Downloads