I can’t seems to find the problem. I imported the Spotify.js file correctly and I don’t know why the Spotify methods are undefined.
On your github the savePlaylist() method saves the token that is generated into a variable called aToken.
Which is not used in your headers variable like you have in the search() method.
Remove curly braces,
I tried, still TypeError.