No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Article

Migrating to MusicKit on the Web 3


The main changes in version 3 as compared to version 1:

  • configure() is now async. It returns a Promise.
  • No more support for declarative HTML. Support for the declarativeMarkup configuration option has been removed, and is no longer enabled by default. Consider using MusicKit Web Components.
  • Flattened APIs. You no longer need need to use the player object on the instance to access functionality. For example, in version 1, music.player.play() was used to start playback, where in version 3, it is music.play().
  • New pass-through API to access the Apple Music API.
  • setQueue in version 1 would queue up songs that were unplayable. In version 3, only songs that are playable will be included in the queue.

Here is a table of changes in the API:

v1v3v3 Notes
const music = MusicKit.configure({})const music = await MusicKit.configure({})You should wait for the promise to resolve before using MusicKit.getInstance().
MusicKit.configure({ declarativeMarkup: true })Removed in favor of MusicKit Web ComponentsSee Getting Started for more information.
music.api.album(1025210938)music.api.music('v1/catalog/{{storefrontId}}/albums/1025210938')See MusicKitAPI and the Passthrough API Method for more information.