Now Playing: A Quick Intro to Spotify's API with React
Why Stack Overflow recommends it
Stack Overflow users link it as the starting point they followed when building React and Node apps against the Spotify API, usually before asking a follow-up question about tokens or playback.
Recommended by 2 people across 2 different months, 2019 to 2022.
What it is
A 29-minute tutorial by Jonny Kalambay that walks through building a small 'Now Playing' app using Spotify's Web API with Node and React. It covers authenticating the user with Spotify OAuth and fetching the current playback state, with finished code on GitHub and a companion Medium article.
What people said
Recommends Obaid-ur-Rehman Ashfaq · 2019-05 · Stack Overflow · on “Spotify web playback api web application”
So I'm trying to create a basic react application that uses the Spotify APIs to play music. I'm very new to react and so far i have written/collected two different codes from different sources. The first one is "App.js" (which i got by following [this video] ) which authenticates the user, generates a token id. So when i run it on localhost:3000 the app goes to localhost:8888 to fetch the token and then back to localhost:3000 where my web app is hosted. The second one is a very simple html code "test.html" which I got from the Spotify for developers website [LINK] which allows the user to play music given the token has been hard-coded into the html. I want to merge the functionality of these two
Recommends Chris · 2022-03 · Stack Overflow · on “How do I store my Spotify access_token local so I can access it in different Javascript files”
Hi Im relatively new to coding with Javascript, and Im trying to work out how I can access Spotify API's access_token within different javascript files. Im running two local server, one React and the other in node. The React server has a button that allows the user to login with Spotify's Oauth in the node server and then the access token and refresh token are redirect successfully back to the react server. The OAuth works quite well as I got it from the Spotify API guide they provide. The way I set up these files is that in my main project I have a auther-server older which includes the Spotify OAuth files and a client folder which is where i create my React app in. Here is where i got the
Cites Cole Perry · 2020-03 · Stack Overflow · on “React Node.js with Spotify-web-api trouble getting playlist information”
I'm building a small web app with React just to learn to use the Spotify API: [LINK] and following this tutorial: [this video] . But I've run into a problem. I have this function: getNowPlaying(){ spotifyApi.getMyCurrentPlaybackState() .then((response) => { console.log(response); this.setState({ nowPlaying: { name: response.item.name, albumArt: response.item.album.images[0].url } }); }) } That properly returns what I am currently listening to. I also have this: getUserPlaylist(){ spotifyApi.getUserPlaylists('1242952295') .then((response) => { console.log("This is the name of the 5th item in the response object: ", response.items[5].name); }); } That correctly returns the name of the 5th playlist