Permissions

Widgets declare the capabilities they need in the permissions array of manifest.json. Request only what you use — actions whose permission you haven’t declared simply do nothing.

"permissions": ["artwork", "playbackControl"]

Available permissions

PermissionGrants
artworkAccess to album artwork via getArtworkDataURL() and track.artworkData.
playbackControlplayPause(), next(), previous().
volumeControlincreaseVolume(), decreaseVolume(), toggleMute(), setVolume().
lovetoggleLove() and toggleDislike() (Apple Music).
ratingControlStar ratings: setRating(), increaseRating(), decreaseRating(), removeRating() (Apple Music only).
shuffleRepeatControltoggleShuffle(), toggleRepeat().
playerActivationactivatePlayer(), switchPlayer().

Capabilities vs. permissions

Permissions are what your widget asks for. Capabilities are what the current player supports — read them from NepTunes.capabilities. For example, Spotify doesn’t expose star ratings, so capabilities.canRate is false even if you hold the ratingControl permission. Check capabilities before showing controls that the active player can’t fulfil:

if (NepTunes.capabilities.canLove) {
  loveButton.hidden = false;
}

← Settings schemaDebugging →