Some questions about tokens

Hello all,


I've finally managed to authorize succesfully with MusicKit. However, I'm not sure which kind of data I'm supposed to pass "in the open" and which should be "hidden". For example, the `developerToken` I'm obtaining from a python server-side script. I'm passing it via an Ajax call, is it safe?


Which tokens/identifiers should I keep "secret"? only my private keys?


document.addEventListener('musickitloaded', function() {

// MusicKit global is now defined

console.log("Hello!");

MusicKit.configure({

developerToken: '', // here I'm entering the token returned from the JWT (decoded)

app: {

name: 'MyAppName',

build: '1'

}

});

let music = MusicKit.getInstance();

music.authorize();

});

Also, when I'm using


`music.api.library.artists()`


I'm getting 25 results at most. How can I paginate?

Zeroedge -


You can pass in an object literal to the artists method and have it used as the query parameters the server API call. You can find documentation on this specific endpoints query parameters at https://developer.apple.com/documentation/applemusicapi/get_all_library_artists


For the example you provided, if you wanted to get the maximum results per page (100) you would use the following:


music.api.library.artists({ limit: 100 }).then(function(results) {
     // results would be up to 100
});


Hope this helps!

Some questions about tokens
 
 
Q