1.0.1 • Published 5 years ago

@muxu-muxu/spotify-activity-listener v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Spotify Activity Listener

npm.io npm.io

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

ParameterTypeRequiredDefault valueDescription
api_keystringtrueLast.fm apiKey
usernamestringtrueLast.fm username
callbackfunctiontrueCallback
trackCountnumberfalse1Capped at 50
pollIntervalnumberfalse10000in ms