Implicit Grant Authorization for Spotify Web API JS on Electron

Hi, I’m building a simple app that displays various information, one of which is the current playing track of someone’s Spotify account. I’m confused with how to grant authorization to Spotify’s WebAPI in Electron whilst using a wrapper called Spotify Web API JS (https://github.com/jmperez/spotify-web-api-js).

I setup an example page and used localhost:8888 as a loopback URI, logged into my Spotify account and retrieved my access token. Then I used the Spotify Web API JS to try and pull the info I wanted but I keep receiving a 401 error in the console.

Here is my JS:
var SpotifyWebApi = require(‘spotify-web-api-js’);

var spotifyApi = new SpotifyWebApi();
spotifyApi.setAccessToken('MyTokenGoesHere);

function spotify() {
    spotifyApi.getMyCurrentPlayingTrack()  // note that we don't pass a user id
    .then(function(data) {
    console.log('Current playing track', data);
}, function(err) {
    console.error(err);
});
}

I’ve installed the wrapper package via Electron and I plugged my access token into that JS code, so I’m thinking I haven’t properly authorized my account.

Any ideas?