Socket
Socket
Sign inDemoInstall

spotify-zeroconf

Package Overview
Dependencies
139
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spotify-zeroconf

Spotify Web API authentication, the easy way.


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

spotify-zeroconf

Spotify Web API authentication, the easy way.

npm version


About this library

spotify-zeroconf is a partial rewrite of librespot that has one goal:

To provide you with a Spotify Web API token without having to input your username and password.

How does it work

Basically, this library takes advantage of the Spotify Connect protocol and brodcasts itself as a Spotify compatible device on your network. Once you click on the device using any Spotify client (desktop, mobile…), it will perform multiple handshakes and authentication rounds with the Spotify access points, and provide you with a token that you will be able to use with the Spotify Web API.


Click me!


There are more details in the librespot wiki (especially the Authentication and Connection parts).

Installation

npm i spotify-zeroconf

Usage

const spotifyZeroconf = require('spotify-zeroconf')

// Only clientId is required.
const credentials = await spotifyZeroconf({
    clientId: // [Required] Id of your spotify application
    scope: // Scopes with a comma separator. Defaults to a list containing every scope. (see here: https://developer.spotify.com/documentation/general/guides/scopes/)
    deviceName: // Name of the device that appears on the network. Defaults to 'Spotify Zeroconf'.
    noCache: // If true, will not store the first handshake credentials and will force the device to appear on the network every time the function is called. Defaults to false.
    authType: // 'token' (default) or 'code'. Code will give you an access code that you can exchange for a token and a refresh_token, but you will need the client_secret. (see here: https://developer.spotify.com/documentation/general/guides/authorization-guide/#2-have-your-application-request-refresh-and-access-tokens-spotify-returns-access-and-refresh-tokens)
})

// Web API token.
console.log(credentials.accessToken)

FAQs

Last updated on 03 Feb 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