Last.fm scrobble and listening activity endpoint for Indiekit
  • JavaScript 78.5%
  • Nunjucks 16.7%
  • CSS 4.8%
Find a file
Ricardo 69683db924 fix: add missing widget.title locale key across all languages
The lastfm.widget.title key was referenced in the admin template but missing
from locale files, causing raw key strings to display instead of labels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:19:12 +01:00
assets fix: use upstream @indiekit/frontend form classes 2026-02-12 20:14:47 +01:00
includes Initial release: Last.fm endpoint for Indiekit 2026-01-24 13:43:56 +01:00
lib fix: store dates as ISO strings instead of Date objects 2026-02-12 22:30:44 +01:00
locales fix: add missing widget.title locale key across all languages 2026-02-17 10:19:12 +01:00
views fix: use upstream @indiekit/frontend form classes 2026-02-12 20:14:47 +01:00
.gitignore Initial release: Last.fm endpoint for Indiekit 2026-01-24 13:43:56 +01:00
CLAUDE.md docs: add CLAUDE.md technical reference 2026-02-13 18:22:27 +01:00
index.js fix(dashboard): resolve template render error and add settings UI 2026-02-03 12:03:43 +01:00
package.json fix: add missing widget.title locale key across all languages 2026-02-17 10:19:12 +01:00
README.md Initial release: Last.fm endpoint for Indiekit 2026-01-24 13:43:56 +01:00

@rmdes/indiekit-endpoint-lastfm

Last.fm scrobble and listening activity endpoint for Indiekit.

Features

  • Display scrobble history from Last.fm
  • Now playing / recently played status
  • Loved tracks
  • Listening statistics (top artists, albums, trends)
  • Background sync to MongoDB for offline access
  • Public JSON API for frontend integration

Installation

npm install @rmdes/indiekit-endpoint-lastfm

Configuration

Add to your Indiekit config:

import LastFmEndpoint from "@rmdes/indiekit-endpoint-lastfm";

export default {
  plugins: [
    "@rmdes/indiekit-endpoint-lastfm",
    // ... other plugins
  ],

  "@rmdes/indiekit-endpoint-lastfm": {
    mountPath: "/lastfmapi",
    apiKey: process.env.LASTFM_API_KEY,
    username: process.env.LASTFM_USERNAME,
    cacheTtl: 900_000,        // 15 minutes
    syncInterval: 300_000,    // 5 minutes
    limits: {
      scrobbles: 20,
      loved: 20,
      topArtists: 10,
      topAlbums: 10,
    },
  },
};

Environment Variables

Variable Description
LASTFM_API_KEY Your Last.fm API key (get one here)
LASTFM_USERNAME Last.fm username to track

API Endpoints

Endpoint Description
GET /api/now-playing Current or recently played track
GET /api/scrobbles Paginated scrobble history
GET /api/loved Paginated loved tracks
GET /api/stats Listening statistics
GET /api/stats/trends Daily scrobble trends

Requirements

  • Node.js >= 20
  • Indiekit >= 1.0.0-beta.25
  • MongoDB (for background sync and statistics)

License

MIT