This humix module is essentially a wrapper for the spotify-web-api-node module and it can make your Humix-Think easier to play review music on Spotify.
git clone https://github.com/heretse/humix-spotify-module.git
cd humix-spotify-module
npm install
Option1 : modify config.js
Basically, you need to configure two information:
- Spotify Client Id
- Spotify Client Secret
Example config looks like:
module.exports = {
spotify: {
clientId : 'Your client id',
clientSecret : 'Your client secret',
}
};
Option2 : use global humix config file (recommended)
You can also provide the config of this module using the global humix config file, which is located at ~/.humix/config.js
The content is the same as option1, but now you move these config under the "humix-spotify-module" properties. Example config looks like
module.exports = {
...
'humix-spotify-module':{
spotify: {
clientId : 'Your client id',
clientSecret : 'Your client secret',
}
}
}
Basically, this module has provided three commands for your Humix-Think to control:
- play-spotify: Play a preview music with the specific song name and artist name
- pause-spotify: Pause the player
- stop-spotify: Stop the play and reset its queue
**The play-spotify needs a input payload with the following JSON format: **
{
songName: 'Shape of you', // This field is required
artistName: 'Ed Sheeran'
}
npm start