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

I started Belnades because I wanted to make my own version of a Spotify CLI, but rather than using Rust, C, or Python, I wanted to use NodeJS and Typescript. There was a lack of Javascript libraries for the Spotify API, so I made my own. The goal is to be able to access the Spotify Web API and be able to be used as a Spotify Connect client.
#### Why the name?
The Spotify CLI that I wanted to make was going to be named Belmont. If you get the connection, let's be friends.
- Features
- Installation
- Usage
- Documentation
- Dependencies
- Credit
- Lisence
- Authenticate using Authorization Code with PKCE Flow or Client Credentials Flow
- Supports Callbacks and Async/Await
- Wrapper to access all Spotify Web API endpoints
- Spotify Connect functionality
Using npm:
``bash`
$ npm install belnades --save
`js
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()
`
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/.
- superagent - Used for requests. (May change for axios)
- express - Used for authentication code flow.
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.