PHPackages                             scottboms/kirby-applemusic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. scottboms/kirby-applemusic

ActiveKirby-plugin[API Development](/categories/api)

scottboms/kirby-applemusic
==========================

Apple Music plugin for Kirby

2.4.0(8mo ago)231[1 PRs](https://github.com/scottboms/kirby-applemusic/pulls)MITPHPPHP &gt;=8.1.0

Since Jun 20Pushed 5mo agoCompare

[ Source](https://github.com/scottboms/kirby-applemusic)[ Packagist](https://packagist.org/packages/scottboms/kirby-applemusic)[ Docs](https://github.com/scottboms/kirby-applemusic)[ RSS](/packages/scottboms-kirby-applemusic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (29)Used By (0)

Apple Music for Kirby
=====================

[](#apple-music-for-kirby)

[![Plugin Preview](src/assets/apple-music-plugin.jpg)](src/assets/apple-music-plugin.jpg)

Adds Field and Block types for Apple Music including a live preview of embeds in the panel. Version 2.0.0 introduces an optional Panel Area that integrates with the [Apple Music API](https://developer.apple.com/documentation/applemusicapi/) (requires a paid [Apple Developer account](https://developer.apple.com)) to display recently played songs using an authenticated Apple Music account. Results provide quick access to copy a song's URL and embed code. Recently played songs can also be exposed to templates using a provided snippet.

Installation
------------

[](#installation)

### [Kirby CLI](https://github.com/getkirby/cli)

[](#kirby-cli)

```
kirby plugin:install scottboms/kirby-applemusic
```

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/scottboms/kirby-applemusic.git site/plugins/kirby-applemusic
```

### Copy and Paste

[](#copy-and-paste)

1. [Download](https://github.com/scottboms/kirby-applemusic/archive/master.zip) the contents of this repository as Zip file.
2. Rename the extracted folder to `kirby-applemusic` and copy it into the `site/plugins/` directory in your Kirby project.

Configuration Options
---------------------

[](#configuration-options)

An optional configuration setting can be set to override the default format for the field.

PropertyDefaultReq?Descriptionscottboms.applemusic.format`link`NoSets the field type format - `link` or `embed`**Example Use (in config/config.php):**

```
return [
  scottboms.applemusic.format => 'embed'
]
```

If using the [Apple Music API](https://developer.apple.com/documentation/applemusicapi/), you will first need to generate the necessary keys and p8 token. Those values can then be added to your site config which will allow access from the Panel and also to your templates.

**Required:**

These private properties should be stored securely outside version control systems. This can be done by creating an `env.php` file in the site/config folder and adding that to your `.gitignore` rules.

PropertyDefaultReq?DescriptionteamId`null`YesAvailable from Apple Developer account profilekeyId`null`YesA generated Apple Music Media ID KeyprivateKey`null`YesThe raw contents of the generated .p8 tokenallowedOrigins`null`NoAn array of domains to allow for handling CORS responses**Example Use (in config/env.php):**

```
return [
  // private plugin config
  'scottboms.applemusic' => [
    'teamId' => 'ABCDE12345',
    'keyId' => '1A2BC3DEFG',
    'privateKey' => '-----BEGIN PRIVATE KEY-----///-----END PRIVATE KEY-----',
    'allowedOrigins' => [
      'https://example.com', 'https://yoursite.com'
    ],
  ],
]
```

**Optional Config Overrides:**

PropertyDefaultReq?DescriptiontokenTtl`3600`NoLength of time token persists in seconds (6 min)tokenCacheTtlMinutes`43200`NoLength of time for tokenCache to persist (30 days)songsLimit`15`NoThe number of songs to show in the Panel AreasongsToShow`12`NoThe number of songs to show via the included snippet**Example Use (in config/config.php):**

```
return [
  // applemusic plugin config
  'scottboms.applemusic' => [
    'tokenTtl' => 4800,
    'songsLimit' => 10,
    'songsToShow' => 6
  ],
]
```

**Cache Settings:**

Turn on file caching for the plugin using:

```
return [
	cache => [
		'scottboms.applemusic' => [
			'type' => 'file',
		]
	],
]
```

Usage
-----

[](#usage)

### Blueprints

[](#blueprints)

In a Page blueprint, add a new field with the type `applemusic.` Standard field attributes such as `label, required, help`, etc. can also be used to override the defaults. Use `emptyText` to change the default text displayed when the field is in an empty state.

```
  music:
    label: Apple Music Embed
    type: applemusic
    emptyText: 'Click to paste Apple Music embed code'

  blocks:
    type: blocks
    fieldsets:
      - heading
      - text
      - image
      - applemusic
```

### Templates and Snippets

[](#templates-and-snippets)

If using the defaults, and based on the example Blueprint above, to render the field in your template you can use ``. Note that any additional helper functions applied may break the embed. You do not need to use `->kt()` or `->kti()` for example.

If using the `link` format, a custom snippet is included to handle formatting the link into a properly formatted `` embed. For example:

```

```

If using the API, a snippet is included to handle displaying a customizable grid of recent songs.

```

```

Compatibility
-------------

[](#compatibility)

- Kirby 4.x
- Kirby 5.x

Disclaimer
----------

[](#disclaimer)

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test before using it in a production environment. If you identify an issue, typo, etc, please [create a new issue](/issues/new) so I can investigate.

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance68

Regular maintenance activity

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

26

Last Release

240d ago

Major Versions

1.2.4 → 2.0.02025-08-18

PHP version history (2 changes)1.0.0PHP &gt;8.1.0 &lt;8.4.0

2.0.0PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7fe992cb700bd1c87d7f38166ab082629485bf502f9356e00f0b3cd81112301?d=identicon)[scottboms](/maintainers/scottboms)

---

Top Contributors

[![scottboms](https://avatars.githubusercontent.com/u/22081?v=4)](https://github.com/scottboms "scottboms (48 commits)")

---

Tags

apiapple-musickirbykirby-cmskirby-pluginkirby4kirby5apikirbykirby-pluginkirby-cmsmusickirby5kirby5-pluginkirby4applemusic

### Embed Badge

![Health badge](/badges/scottboms-kirby-applemusic/health.svg)

```
[![Health](https://phpackages.com/badges/scottboms-kirby-applemusic/health.svg)](https://phpackages.com/packages/scottboms-kirby-applemusic)
```

###  Alternatives

[getkirby/kql

Kirby Query Language

15124.3k](/packages/getkirby-kql)[beebmx/kirby-env

Enable env variables to Kirby

2037.9k2](/packages/beebmx-kirby-env)[bnomei/kirby3-redirects

Setup performant HTTP Status Code Redirects from within the Kirby Panel

269.1k](/packages/bnomei-kirby3-redirects)[pechente/kirby-admin-bar

Kirby Admin Bar

512.2k](/packages/pechente-kirby-admin-bar)[beebmx/kirby-courier

Courier offers a convenient and painless solution for creating emails tailored for your Kirby website.

403.0k2](/packages/beebmx-kirby-courier)[bnomei/kirby3-feed

Generate a Atom/JSON/RSS-Feed and XML-Sitemap from Pages-Collections

7224.8k](/packages/bnomei-kirby3-feed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
