spotify-device-authentication
v0.0.2
Published
logs in to spotify device api to get authentication blob
Downloads
143
Readme
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));
// val is: {username: 'yourUserName', authType: 1, authData: Buffer}
}
});
Using Promise:
const credentialGenerator = require('spotify-device-authentication');
credentialGenerator('yourUserName', 'yourPassword')
.then(function(val) {
console.log(JSON.stringify(val));
// val is: {username: 'yourUserName', authType: 1, authData: Buffer}
})
.catch(function(err) {
console.log(err);
});