spotify-web-api-node icon indicating copy to clipboard operation
spotify-web-api-node copied to clipboard

TypeError: createAuthorizeURL is not a function error

Open tknura opened this issue 4 years ago • 2 comments

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)

tknura avatar Jun 11 '21 20:06 tknura

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

furkanayilmaz avatar Nov 24 '21 06:11 furkanayilmaz

If you're using Webpack, don't forget to add the target: "node" setting to not accidentally package the module along with your code.

7coil avatar Dec 26 '21 03:12 7coil