@muxu-muxu/spotify-activity-listener
v1.0.1
Published
Display your most recents Spotify listens
Downloads
3
Readme
Spotify Activity Listener
Prerequisites
Installation
npm install @muxu-muxu/spotify-activity-listener
or
yarn add @muxu-muxu/spotify-activity-listener
Usage
import SpotifyListener from "@muxu-muxu/spotify-activity-listener";
this.Listener = new SpotifyListener({
username: 'LAST_FM_USERNAME',
apiKey: 'LAST_FM_API_KEY',
callback: {() => {}}
});
componentDidMount() {
this.Listener.startListening();
}
componentWillUnmount() {
this.Listener.stopListening();
}
API Docs
| Parameter | Type | Required | Default value | Description |
| :------------: | :--------: | :------: | :-----------: | :--------------: |
| api_key
| string
| true | | Last.fm apiKey |
| username
| string
| true | | Last.fm username |
| callback
| function
| true | | Callback |
| trackCount
| number
| false | 1 | Capped at 50 |
| pollInterval
| number
| false | 10000 | in ms |