Socket
Socket
Sign inDemoInstall

spotify-current-track

Package Overview
Dependencies
21
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spotify-current-track

Simple wrapper class for obtaining current track from Spotify Web API.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
2.13 MB
Created
Weekly downloads
 

Readme

Source

spotify-current-track

npm npm npm paypal

Simple wrapper class for obtaining current track from Spotify Web API.


Install

Via npm [package]:

$ npm install spotify-current-track

Via yarn [package]:

$ yarn add spotify-current-track

Usage

// require lib
const SpotifyAPI = require("spotify-current-track");

// init lib
const spotify = new SpotifyAPI({
	// [required] fill in your spotify credentials
	clientId: "<CLIENT_ID>",
	clientSecret: "<CLIENT_SECRET>",
	refreshToken: "<REFRESH_TOKEN>",
	// [optional] override default request timeout, defaults to 0 (no timeout)
	_timeout: 1000 // milliseconds
});

// [optional] set market
spotify.market = "SK";

// get current track
spotify.currentTrack.then(track => {
	// ...
}).catch(console.error);

clientId and clientSecret can be obtained from your own Spotify App.

refreshToken can be obtained by Authorization Code Flow with user-read-currently-playing and/or user-read-playback-state scope.

Set market if you want to apply Track Relinking.

Example track object can be found here.


License

MIT

Keywords

FAQs

Last updated on 02 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc