Options
All
  • Public
  • Public/Protected
  • All
Menu

belnades

Belnades

Belnades Logo

Belnades is a Spotify API wrapper that runs on NodeJS, meant to be run client side without the need for a browser.

Motivation

I started Belnades because of the limited amount of libraries available for the Spotify API in Javascript. Many of them are written for Python and C.

Table of Contents

Features

What I want to add

  • Spotify Connect functionality

Installation

Using npm:

$ npm install belnades --save

Usage

const { WebAPI, AuthorizationCodeFlow, Scope } = require('belmont')

const authorization = new AuthorizationCodeFlow('CLIENT_ID') //Your client id
const webApi = new WebAPI()

// Play music
async function playMusic() {
    try {
        //Authorize using the user-modified-playback-state scope
        let accessToken = await authorization.authorize([Scope.USER_MODIFIED_PLAYBACK_STATE])

        //Set access token of WebAPI
        webApi.setAccessToken(accessToken)

        //Call API
        await webApi.resumePlayback()
    } catch (error) {
        console.log(error)
    }
}

playMusic()

Documentation

For documentation locally, you can view index.html in the docs folder. Or you can visit https://zackumar.github.io/Belnades/. Also check out Spotify's official documentation at https://developer.spotify.com/documentation/.

Credit

Belnades is inspired by Spotify Web API Node and the lovely work put in by thelinmichael, JMPerez, and its contributors. The authorization flows are based off of Spotify's Account Authentication Examples.

License

MIT

Generated using TypeDoc