spotify-device-authentication

0.0.2 • Public • Published

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);
    });

Package Sidebar

Install

npm i spotify-device-authentication

Weekly Downloads

11

Version

0.0.2

License

MIT

Unpacked Size

27 kB

Total Files

10

Last publish

Collaborators

  • twonky4