How To Use Spotify's API With React

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024

Комментарии • 104

  • @averywicks6892
    @averywicks6892  4 года назад +16

    Spotify and React! Nice combination. Let me know what you guys think!

    • @theuiniqueps10
      @theuiniqueps10 3 года назад

      can we also play these songs after adding a play button or so? If yes, how? please answer!

    • @himanshuraj4766
      @himanshuraj4766 Год назад +1

      Please make a video on how to use spotify api with vue js. There is no any video on youtube for this.plzzzz

  • @StuffToDaMax
    @StuffToDaMax 3 года назад +16

    Love the way you direct the focus away from copying your code and into understanding the core concepts.

    • @averywicks6892
      @averywicks6892  3 года назад +3

      Sorry for the late response. Appreciate the feedback! Doing my best!

  • @velikiy2463
    @velikiy2463 4 года назад +8

    I chose to use the Spotify API for my university project this semester and I have to say, despite me using Angular, the two tutorials you did about this topic have been absolutely life saving man. Thank you, keep grinding and good luck! Subscribed!

    • @averywicks6892
      @averywicks6892  4 года назад

      Great feeling know that this video was helpful to you!! Tx for subscribing and commenting!

    • @beatlesbob74120
      @beatlesbob74120 4 года назад +1

      Hi I'm sorry to ask but I've some trouble to use with Angular can u explain how you do your httprequest for authorization

    • @velikiy2463
      @velikiy2463 4 года назад

      @@beatlesbob74120 Hey! It's no problem, it took me a while to get it right too haha:) Here is the code for my HttpOptions variable, which I put as the last input variable in my post request:
      const getTokenHttpOptions = {
      headers: new HttpHeaders({
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': 'Basic ' + btoa(clientId + ':' + clientSecret)
      }),
      }.
      Let me know if this helps! Good luck!:)

    • @beatlesbob74120
      @beatlesbob74120 4 года назад

      @@velikiy2463 Ty very much but about data you put it like this :
      data ={
      "grant_type": "client_credentials"
      }
      getToken(){
      return this.http.post(this.token_url,this.data,{headers:this.header})
      }

    • @velikiy2463
      @velikiy2463 4 года назад +1

      @@beatlesbob74120 For my data I put it like this:
      return this.http.post(this.tokenUrl, 'grant_type=client_credentials', getTokenHttpOptions);
      My way worked, I can't say if yours will.

  • @kareemdabbour4680
    @kareemdabbour4680 4 года назад +5

    Man, you deserve so much more attention! Great video and an amazing way of explaining things! Wish you the best!

    • @averywicks6892
      @averywicks6892  4 года назад +1

      So appreciate that comment man! Nice to know that the videos help :) Tx for watching.

    • @BigDub24
      @BigDub24 4 года назад

      the share button can help with that

  • @ryanfallon4538
    @ryanfallon4538 4 года назад +3

    This was great. A lot of tutorials can be very dry, but this was super engaging.

    • @averywicks6892
      @averywicks6892  4 года назад

      So dope! Appreciate the feedback man! Tx for watching

  • @twest7002
    @twest7002 4 года назад +2

    Man! I really appreciate all the work you put in. It shows that good informative content is important to you. thanks

  • @folalekan
    @folalekan 4 года назад +2

    Just started learning react was told to build a music blog using reactjs. But this was cool watching and learning. kindly zoom in more, hoping to catch up soon.

  • @Cheesieshorts
    @Cheesieshorts 3 года назад +1

    Great video!! Thanks so much for helping me out haha studying at university and trying to get some side projects done wanted to do something with spotify api and react for so long! This is a great start thanks so much

    • @averywicks6892
      @averywicks6892  3 года назад

      Awesome! Thx for saying that! Helps me to know the videos help!

  • @russooneateseven
    @russooneateseven 3 года назад +1

    It was a great follow along. I like how you stop and talk about what you're going to do before you do it. This gives more context to your actions. The one thing I wish you explained, was the authorization flow you decided to go with. You talked about it very well. But trying to following with Spotify docs, they give four types:
    Refreshable user authorization: Authorization Code Flow
    Refreshable user authorization: Authorization Code Flow With Proof Key for Code Exchange (PKCE)
    Temporary user authorization: Implicit Grant
    Refreshable app authorization: Client Credentials Flow
    And it's not clear which one you went with. I saw tid bits of a couple hints between several of them.
    I think it's very important to understand how to find these things for myself while learning with you.
    If you could comment here on which one you chose, I'd much appreciate it.
    Otherwise, great video!

  • @danielmdenton
    @danielmdenton 2 года назад

    Appreciate this video. I'm doing a programming bootcamp project and I was a little apprehensive about using the spotify API but you make it look pretty simple.

  • @kenbee85
    @kenbee85 2 года назад

    Bro I really learn a lot from this. I hope you continue doing this

  • @dudududududududududududududu
    @dudududududududududududududu 3 года назад

    You're really great, you've just shown me everything i needed in the moment. I thought i wouldn't be able to understand but you explain in a very comprehensive way. Thanks a lot, from Brazil! hehe

  • @ericvaughn843
    @ericvaughn843 2 года назад

    Love your videos...especially with the code explanations. Would love to be able to see more of the finished app at the end of the videos though.

  • @billybob7177
    @billybob7177 3 года назад

    Love this tutorial, it helped me understand how to use APIs in general within my Next website a lot more, thanks :D

  • @notsure180
    @notsure180 2 года назад

    It is good to teach the functional components anyways, for the class components - although supported now - will not be supported in the future (from what I read in 2022).
    I am struggling with the Spotify API a bit right now lol, but I got other APIs to work properly. Even with a similar approach to what I did to my other functioning API calls.
    I think it is because of the redirect uris involved in these APIs, but it may be a server issue that I mistakingly overlooked.
    Good video!

    • @notsure180
      @notsure180 2 года назад

      I could get raw HTML from an express server, but rendering a full HTML page (with html that is not in a body tag) has proved to be somewhat of a challenge to me. I am a React newbie though.

  • @matiaspina8471
    @matiaspina8471 4 года назад +1

    Amazing tutorials man! Really useful, thanks for the work!

  • @carrie4839
    @carrie4839 3 года назад +1

    I love your style! Keep creating!!!

  • @rdubb77
    @rdubb77 3 года назад +1

    Thank you! This totally made me get functional components and hooks. One bit of advice, speak a little bit slower and enunciate a bit more. You said so many important things that became comments in my code, but I had to listen a number of times in places so I could transcribe clearly what you said.

  • @purradin
    @purradin 4 года назад +5

    Yes... Great content. Just the kind of teacher I have been looking for. Only real note I have is zoom in a bit more on your code. Otherwise good job.

    • @averywicks6892
      @averywicks6892  4 года назад +1

      Noted! Zoom in more :) Thx for the feedback!

  • @kamelaoulaiche2966
    @kamelaoulaiche2966 4 года назад +1

    Trop fort!!!! depuis le temps que je cherchais ce tuto!!!! thx

  • @Roxdayz
    @Roxdayz 3 года назад +4

    i'm so great i found this!!! i have one question: how did you know how to get the token? i've read the docs and it says to create a server with node to get an access token.

    • @BobbyBundlez
      @BobbyBundlez 3 года назад

      Yeah this tutorial really doesn't explain shit tbh

  • @node-ks
    @node-ks 3 года назад +1

    You're my new favorite on YT. Periot.

    • @averywicks6892
      @averywicks6892  3 года назад

      Ha! Really appreciate it. Thx for watching the videos. More coming soon!

  • @franklinodigbo
    @franklinodigbo Год назад

    This might be what I have been looking for. Let me see if it works. I will come back and give a proper review.
    PS: I am using typescript

  • @StefanoBallad
    @StefanoBallad 3 года назад

    Min 18:37 -> "Breakfast At Tiffany's", one of my fav songs! 😀

  • @charlibiris
    @charlibiris 4 года назад +1

    Hey great vid! Subscribed!

    • @averywicks6892
      @averywicks6892  4 года назад

      Tx buddy! Appreciate the feedback and subscription!

  • @GSTA24
    @GSTA24 4 года назад +1

    Great video, really appreciate the time you took to make it, along with all the animated graphics!
    Question; after you lifted all your state up into app.js it started to get more complex, and imagine if your application grows with a search box or track scrubbing for playing music etc... I assume the logical next step would be to make components to contain pieces of the state and functionality, app.js then only needs to hold *shared state* between different containing components? (Hope that made sense.)
    Code review; you destructure an array into an array:
    const tracks = [...someTracksToPlay]
    This would be the same as const tracks = someTracksToPlay
    If you want to make a copy of the original array, there is the Array.copyWithin method as well, food for thought.
    Also you use promises with .then in your useEffects - maybe you should explain why you're not using async/await because react doesn't let you 😊

    • @averywicks6892
      @averywicks6892  4 года назад +1

      This is the best feedback! Thx !
      Yes, I could have the child components contain individual state. Before that, I would probably attempt to refactor the app component. For example, I could've created a custom hook to handle my http api calls. That would simplify my app component as well.
      Regarding, "destructuring an array into an array", that's a great catch LOL. At the time, "destructuring" was probably running through my head that I didn't consider using a simpler method LOL.
      Also, regarding "explaining use of .then", I'll make sure to mention that next time.
      Tx for watching and providing detailed feedback!

    • @GSTA24
      @GSTA24 4 года назад +2

      @@averywicks6892 yeah that's exactly what I mean - I'm at a stage right now where refactoring app.js is more difficult than it should be because I told myself not to lift up all the state and now it's all over the place 😅
      Anyway subscribed 👍

    • @averywicks6892
      @averywicks6892  4 года назад +1

      @@GSTA24 Life of programmer right. Tx for the subscription LOL

  • @_maizon
    @_maizon 3 года назад

    just what i needed

  • @wtbgothgf
    @wtbgothgf 3 года назад

    Love the tutorial. Do you know where I can set scopes? For instance, for reading the authenticated user's top tracks.

  • @radon592
    @radon592 3 года назад

    Man you are amazing!

  • @madisonevans1777
    @madisonevans1777 2 года назад +1

    I seem to be getting a 400 error 'ERR_BAD_REQUEST' that I can't seem to solve. Any suggestions?

  • @christophergonzalez553
    @christophergonzalez553 3 года назад

    I'm confused on how exactly you changed the app styling you weren't very specific at all on how you used the mockflow design in the react app (other than copy and pasting old code)
    Edit: it seems that the styling is bootstrap stuff, which I understand is a whole other tutorial, I also followed the javascript tutorial and All in all this was a really good tutorial, thank you very so much!

  • @juanmartin3404
    @juanmartin3404 3 года назад

    bro you are amaizing

  • @joseluissanchezortiz3599
    @joseluissanchezortiz3599 3 года назад +2

    excelent friend. I get a question: what softw do you use to show the explication with animation? thank you

    • @averywicks6892
      @averywicks6892  3 года назад +2

      Thx for watching! Feel free to share the channel!. I use Adobe After Effects and Adobe Premiere for all my animations. Hope that answers your question. The animations are custom.

  • @_rizkypm
    @_rizkypm 3 года назад +1

    Its nice, but you should zoom on your vscode, beacuse its too small to see

  • @cartman78manolo
    @cartman78manolo 4 года назад +1

    nice one mate! Do you went trough Spotify documentation or you got the inspiration from other source? Thanks.

    • @averywicks6892
      @averywicks6892  4 года назад +1

      I actually did end up going through Spotify's documentation! Thx for watching! Really appreciate it!

  • @benjaminikwuagwu6469
    @benjaminikwuagwu6469 3 года назад +1

    Great tutorial! Can I use the same code with few changes for react native?

    • @averywicks6892
      @averywicks6892  3 года назад

      Appreciate the feedback. Honestly, I haven't
      dived into React Native, so I'm not sure LOL.

    • @benjaminikwuagwu6469
      @benjaminikwuagwu6469 3 года назад

      @@averywicks6892Ok, thanks. I really need a tutorial on Spotify and React Native integration

    • @benjaminikwuagwu6469
      @benjaminikwuagwu6469 3 года назад

      @@averywicks6892Ok, thanks. I really need a tutorial on Spotify and React Native integration

  • @coreyjordan2341
    @coreyjordan2341 3 года назад

    Man, I hope you see this. I'm working on a capstone for my bootcamp and I want to make something similar to this, but using a specific podcast and seeing categories of their episodes. is that possibe?

  • @taofiqcodes4303
    @taofiqcodes4303 3 года назад

    Hi Avery thank you for thos great video really appreciate. Dont know if you have any tutorial on API calling and outputting and where to get free API resource

  • @yanathelama1
    @yanathelama1 4 года назад +1

    I may have missed this, but are you hard-coding your own clientID information for this to work? How would you instead generate the login screen for any user to get this information?

    • @averywicks6892
      @averywicks6892  4 года назад +1

      Yes. I'm hard coding my client Id in my credentials.js file. Not ideal, but I took that approach with this tutorial. I believe you'd have to use a different authorization method in order to generate the login screen. I'd check out Spotify's other authorization flows.
      developer.spotify.com/documentation/general/guides/authorization-guide/
      hope this helps!

  • @theuiniqueps10
    @theuiniqueps10 3 года назад

    can we also play these songs after adding a play button or so? please answer!

  • @moreCowBell1001
    @moreCowBell1001 4 года назад +1

    Nice write up and video! I wanted to test the code on github. I noticed there is no 'package.json' file, only a 'package-lock.json'. I am unable to use the command 'npm start'. Any help would be great. Thanks.

    • @averywicks6892
      @averywicks6892  4 года назад +1

      Just added a package.json file for you! Tx for watching the video!!

  • @lavizpandey9957
    @lavizpandey9957 2 года назад

    Good one!!

  • @Dawmazing
    @Dawmazing 4 года назад +1

    U the goat bro

    • @averywicks6892
      @averywicks6892  4 года назад +1

      LOL. Appreciate it bro! Tx for watching the video. Feel free to share!

  • @ronnynestares3831
    @ronnynestares3831 3 года назад

    I mean that to get the toke and then use it in the endpoints I have to do it in node or could I create a service, as in angular and there do all that stuff?

  • @camilaparadavalderrama6166
    @camilaparadavalderrama6166 3 года назад

    Hi Avery! Quick question, I did the first token post request with fetch but with the same information and it returned a 400 error due to cors I believe. I did the same thing but with axios and it worked. Do you happen to know why? Thank you and great video!

  • @Aks-47
    @Aks-47 3 года назад +1

    Wait so you can play songs on this app now???!!!

  • @TheIDMovement1
    @TheIDMovement1 4 года назад +1

    Dope content

  • @BobbyBundlez
    @BobbyBundlez 3 года назад +1

    how come in the last tutorial it is
    body:'grant_type=client_credentials'
    and in this its
    data:'grant_type=client_credentials'
    also WHERE in the docs is this stated? i am trying to move beyond watching tutorials and i honestly have no idea how you would figure this out lol

  • @JordanAF808
    @JordanAF808 3 года назад +2

    Great video, can you do RUclips API? Thanks!

    • @averywicks6892
      @averywicks6892  3 года назад

      Appreciate the feedback! I'll see what I can cook up :)

  • @JC-fd8ho
    @JC-fd8ho 2 года назад

    how did u know how to use the spotify Api i went to the Docs and i got lost there i don't know what to do Exactly

  • @Tru_lie13
    @Tru_lie13 2 года назад

    At the 8:00 min mark... I was so disappointed. Good one.

  • @BobbyBundlez
    @BobbyBundlez 3 года назад +1

    while this is a really great tutorial i am trying to get past beginner web dev ... ive been coding almost a year and a half now :( and still feel like im stuck in video tutorial hell when it comes to accessing API that are a literally more sophisticated like this. i read over the documentation and i STILL don't see how you would be able to figure out any of this axios request by just reading the docs. can anyone help me? i really have no idea how to learn this stuff anymore byeond just following youtube videos. i want to be able to read documentation and set up the headers, params, etc on my own.

  • @rajatgarg5058
    @rajatgarg5058 3 года назад +1

    What if i want to play the song

    • @theuiniqueps10
      @theuiniqueps10 3 года назад

      did you get the answer? how to actually play the song??

  • @pranitabhagat5496
    @pranitabhagat5496 3 года назад

    Do I need to have Spotify premium account to build this clone?

  • @ddhan288
    @ddhan288 3 года назад

    how to add voice command features?

  • @danieldavison531
    @danieldavison531 4 года назад

    I'm struggling to get my top artists, it looks like i have to authenticate a different way but i can't seem to figure it out...

    • @Peterru5
      @Peterru5 4 года назад

      You have to choose another authorization flow. Authorization Code or Authorization Code with PKCE . developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-flows

  • @BobbyBundlez
    @BobbyBundlez 3 года назад +1

    how tf can u guys read his code?

  • @mati124
    @mati124 3 года назад

    much appreciated but it is incomplete. No security

  • @BobbyBundlez
    @BobbyBundlez 3 года назад +1

    we all just gonna pretend no one got the CORS error? k

  • @frogga2935
    @frogga2935 Год назад

    nerd