Spotifty web api's giving error on ReactJS even after giving proper access tokens

Viewed 20

I'm using spotify-web-api-node package and following this tutorial . First I get my access token from my backend express js server then I pass it to to my reactjs application spotifyApi.setAccessToken(access_token);

after setting the access token, I try to call the any methods that will let me use the web service helper functions it gives me the error in the screenshot.

for example : spotifyApi.searchTracks(search).then((res) => console.log(res)).catch((err) => console.log(err));

but if I try to access this method using postman or from the express Js server using the same token it gives me no error and gives a correct response.

I was following the clone spotify tutorial from youtube and they do it from their reactJs application and it seems to work fine for them, for me however I get the error on my react application.

Error in browser console

0 Answers
Related