Hi, there @ebitar2006
You’re correct that the music.api.library.albums method should be able to return a list of the user’s iCloud Library albums. Per our documentation:
If no ids are passed, this method fetches all the library albums in alphabetical order.
In the code example you provided, music.api.library.albums should be invoked as a function, which will return a Promise that is “then-able”. Also your console.log statement is logging the string "cloudAlbums" and not the argument itself.
Here is the full example with those changes:
music.authorize().then(function() {
music.api.library.albums().then(function(cloudAlbums) {
// user's cloudAlbums
console.log('cloudAlbums', cloudAlbums);
});
});
Your code example may have been copied from the example in our documentation here: https://developer.apple.com/documentation/musickitjs
These docs appear to be incorrect. I’ll follow up on getting them corrected with the same change.