thelinmichael / spotify-web-api-node

A Node.js wrapper for Spotify's Web API.
http://thelinmichael.github.io/spotify-web-api-node/
MIT License
3.1k stars 499 forks source link

refreshAccessToken not FOUND #441

Open iamendy opened 2 years ago

iamendy commented 2 years ago

The function for getting refresh tokens is not available in the library.

spotify-web-api-node refreshAccessToken()

Kindly check.

ludwigjo commented 2 years ago

Hi, you can refresh an access token with refreshAccessToken() but you will have to set the refresh token first with setRefreshToken(refresh_token)

KaranLala commented 2 years ago

I have the same issue, v5.0.2. I've set the refresh token. you can see the code and error below.

    let spotifyApi = new SpotifyWebApi();
    spotifyApi.setRefreshToken(refreshToken);
    spotifyApi.setClientId(process.env.REACT_APP_CLIENT_ID);
    spotifyApi.setClientSecret(process.env.REACT_APP_CLIENT_SECRET);
    return spotifyApi.refreshAccessToken()
                     .then(_ => spotifyApi.getAccessToken());

Uncaught TypeError: spotifyApi.refreshAccessToken is not a function

kyds3k commented 1 year ago

@KaranLala were you able to resolve this? I'm having the same problem.

kyds3k commented 1 year ago

@iamendy were you able to resolve this?

GraysonCAdams commented 1 year ago

@kyds3k Were you able to? Same issue here

ludwigjo commented 1 year ago

@GraysonCAdams Do you mind sharing your implementation?

kyds3k commented 1 year ago

@kyds3k Were you able to? Same issue here

Nope :-( not yet