Help Wizard

Step 1

NEXT STEP

Web SDK

Web SDK

Hey there,

We are trying to use web sdk in order to play songs in our website , and following the docs we found that it is possible using only client id and secret without going through oauth screen where you open spoitfy login and grant access and then spotify returns the code which you can use as access token and refresh token. On the website spotify has GET YOUR ACCESS TOKEN button which generates really long token, however when we generate token using base64(client_id:cleint_secret) we get really short token which does not work. So question is what is the functional of the button that runs under the hood on this page https://developer.spotify.com/documentation/web-playback-sdk/quick-start/
(Green button after this line Since this quick start guide does not cover the authorization flow, we provide a handy button to generate a new access token:)

Reply
2 Replies

You can use any access_token you get from auth flows I think (except Client Credentials Flow)

Hi there and welcome to the forum!

We have a new guide that walks you through how to use the Web Playback SDK with node.js and React: https://developer.spotify.com/documentation/web-playback-sdk/guide/

 

I suggest you have a look at the authorization guide and some of the samples we provide.

 

You might benefit from using an OAuth library into your app to help deal with OAuth. It's hard to make recommendations without knowing which frameworks and technologies you're using. If you're using React you can leverage the guide above but it does require a backend component (node.js). Next.js and their auth library has a provider for Spotify - the same is true for passport.js. This is quick'n'easy to setup and leverage in your project. 

Suggested posts