PHPackages                             detain/phlix-plugin-lastfm - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. detain/phlix-plugin-lastfm

ActivePhlix-plugin[Utility &amp; Helpers](/categories/utility)

detain/phlix-plugin-lastfm
==========================

Last.fm scrobbler plugin for Phlix — scrobbles music playback to Last.fm.

v1.1.0(1mo ago)10MITPHPPHP &gt;=8.3CI passing

Since Jul 11Pushed 3w agoCompare

[ Source](https://github.com/detain/phlix-plugin-lastfm)[ Packagist](https://packagist.org/packages/detain/phlix-plugin-lastfm)[ Docs](https://github.com/detain/phlix-plugin-lastfm)[ RSS](/packages/detain-phlix-plugin-lastfm/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

phlix-plugin-lastfm
===================

[](#phlix-plugin-lastfm)

[![tests](https://github.com/detain/phlix-plugin-lastfm/actions/workflows/test.yml/badge.svg)](https://github.com/detain/phlix-plugin-lastfm/actions/workflows/test.yml)

> Last.fm scrobbler plugin for [Phlix](https://github.com/detain/phlix-server) — scrobbles your music playback to [Last.fm](https://www.last.fm).

Overview
--------

[](#overview)

Connects a Phlix server to your Last.fm account:

- **Now Playing** — on playback start the plugin calls Last.fm `track.updateNowPlaying` so your profile shows what you're listening to in real time.
- **Scrobbling** — on playback stop the plugin submits a `track.scrobble`, enforcing Last.fm's official rule (track longer than 30 seconds **and** more than 50% played) before anything is recorded.
- Authenticates via Last.fm **web auth**, signing every call with your shared secret and storing one session key per Phlix user.

It subscribes to `phlix.playback.started` and `phlix.playback.stopped`.

Install
-------

[](#install)

From the Phlix admin **Plugins** section, paste this repo's URL:

```
https://github.com/detain/phlix-plugin-lastfm

```

…or from the CLI:

```
php bin/phlix plugin:install https://github.com/detain/phlix-plugin-lastfm
```

Settings
--------

[](#settings)

Configure these in the Phlix admin **Plugins → Configure** dialog.

SettingTypeRequiredDefaultDescription`enabled`boolno`false`Master on/off for Last.fm scrobbling. Compared loosely, so truthy values such as `'true'` from `config/lastfm.php` also enable it.`api_key`string**yes**—Your Last.fm API key. Create a free API account at [last.fm/api/account/create](https://www.last.fm/api/account/create).`shared_secret`string (secret)**yes**—The "Shared secret" shown next to your API key on your [Last.fm API accounts](https://www.last.fm/api/accounts) page. Used to sign authenticated requests.> The OAuth "Connect Last.fm" handshake (authorize + callback) is served by the **host** at `GET /api/v1/oauth/lastfm` and `GET /api/v1/oauth/lastfm/callback`; the callback URL is derived from the request host, so no `callback_url` setting is needed. Per-user session keys are stored in `lastfm_sessions` and consumed by the scrobbler.

### Where to get your credentials

[](#where-to-get-your-credentials)

1. Sign in to Last.fm and open [**Create an API account**](https://www.last.fm/api/account/create).
2. Fill in the application name/description; the **Callback URL** should point back at your Phlix server.
3. Copy the **API key** into `api_key` and the **Shared secret** into `shared_secret`.
4. Enable the plugin and toggle `enabled` on.

Development
-----------

[](#development)

```
composer install
vendor/bin/phpunit
vendor/bin/phpstan analyse
```

Static analysis is configured in `phpstan.neon` (level 6 over `src`).

The entry class is `Phlix\Plugins\Scrobbler\Lastfm\LastfmPlugin` (implements `Phlix\Shared\Plugin\LifecycleInterface` and `Phlix\Shared\Plugin\ConfigurableInterface`). It runs inside a Phlix server host, which provides the playback/library services at runtime. `onEnable()` is boot-safe — it only wires collaborators and subscribes events — so the `lastfm_sessions` schema is ensured lazily on the first playback event, when `LastfmScrobbler` invokes the deferred `LastfmMigrationRunner` closure.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

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

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (11 commits)")

---

Tags

last-fmlastfmmedia-servermusicnow-playingphlixphlix-pluginphpplaybackpluginscrobblerscrobblingmusiclast.fmscrobblingscrobblerphlixphlix-plugin

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/detain-phlix-plugin-lastfm/health.svg)

```
[![Health](https://phpackages.com/badges/detain-phlix-plugin-lastfm/health.svg)](https://phpackages.com/packages/detain-phlix-plugin-lastfm)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.4M2.2k](/packages/symfony-symfony)[laravel/framework

The Laravel Framework.

34.9k556.2M21.6k](/packages/laravel-framework)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

568591.1k63](/packages/ecotone-ecotone)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

200569.1k3](/packages/wikimedia-parsoid)

PHPackages © 2026

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