Skip to content

Migration guide for v8

Science Spot edited this page Mar 21, 2021 · 8 revisions

Migration guide for v8

Spotify-api.js v7 had many methods broken and some defects with it! So, incase if you have got habit of v7! Here is our migration changes!

Caching Events

How you need to do it in v7

const client = new Spotify.Client('token', { cacheCurrentUser: true });

function onReady(){
    console.log('Cache is ready!');
} 

if(!client.madeCache) client.cacheOnReady = onReady;
else onReady()

How you do it in v8

const client = new Spotify.Client('token', { 
    cacheCurrentUser: true,
    ready(){
        console.log('Cache is ready');
    }
});

In v8, ready event wont fire if the token is NO TOKEN! So this will be useful if you login later!

Clone this wiki locally