0.0.2 • Published 5 years ago

spotify-device-authentication v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
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));
		// 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);
	});