Closed njsa04 closed 5 years ago
To retrieve a User Music Token from Apple you currently need to use the Musickit JS Library that Apple provides. They do not support an authentication method like oAuth2.
See also: https://developer.apple.com/documentation/musickitjs
You can use this to log the token to your console
<script>
document.addEventListener('musickitloaded', function() {
// MusicKit global is now defined
music = MusicKit.configure({
developerToken: '',
app: {
name: 'test',
build: '1978.4.1'
}
});
music.authorize().then(musicUserToken => {
console.log(musicUserToken);
});
});
</script>
Thanks I got it !
Hi is there a way to request the authorization from a User so that we can get their User Token? Or does this code require you to pass it in or hard code it?
Thanks