spotify-web-api-node
spotify-web-api-node copied to clipboard
TypeError: createAuthorizeURL is not a function error
Hi, I am using this method as shown in an example and on method execution i get an error:
TypeError: spotifyApi.createAuthorizeURL is not a function
I get it only with using version 5.0.2, when I downgraded package to 4.0.0 it works fine
const spotifyApi = new SpotifyWebApi({
clientId: <client id>,
redirectUri: <redirect uri>
})
const authorizeUrl = spotifyApi.createAuthorizeURL(scopes, state)
You will need to get the authroizationURL in node. If you try it in React it will throw an error. Try to do it in Node.JS
If you're using Webpack, don't forget to add the target: "node" setting to not accidentally package the module along with your code.