{"id":50942333,"url":"https://github.com/rmdes/indiekit-endpoint-funkwhale","last_synced_at":"2026-06-17T16:10:26.977Z","repository":{"id":347648038,"uuid":"1140660766","full_name":"rmdes/indiekit-endpoint-funkwhale","owner":"rmdes","description":"an indiekit plugin to display funkwhale data on indiekit + eleventy blog","archived":false,"fork":false,"pushed_at":"2026-04-11T10:02:15.000Z","size":107,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-11T12:06:15.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmdes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-23T15:33:26.000Z","updated_at":"2026-04-11T10:02:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rmdes/indiekit-endpoint-funkwhale","commit_stats":null,"previous_names":["rmdes/indiekit-endpoint-funkwhale"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rmdes/indiekit-endpoint-funkwhale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdes%2Findiekit-endpoint-funkwhale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdes%2Findiekit-endpoint-funkwhale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdes%2Findiekit-endpoint-funkwhale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdes%2Findiekit-endpoint-funkwhale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmdes","download_url":"https://codeload.github.com/rmdes/indiekit-endpoint-funkwhale/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmdes%2Findiekit-endpoint-funkwhale/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34453638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-17T16:10:26.210Z","updated_at":"2026-06-17T16:10:26.972Z","avatar_url":"https://github.com/rmdes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @rmdes/indiekit-endpoint-funkwhale\n\n[![npm version](https://img.shields.io/npm/v/@rmdes/indiekit-endpoint-funkwhale.svg)](https://www.npmjs.com/package/@rmdes/indiekit-endpoint-funkwhale)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nFunkwhale listening activity endpoint for [Indiekit](https://getindiekit.com/).\n\nDisplay your Funkwhale listening history, favorite tracks, and listening statistics on your IndieWeb site.\n\n## Installation\n\nInstall from npm:\n\n```bash\nnpm install @rmdes/indiekit-endpoint-funkwhale\n```\n\n## Features\n\n- **Admin Dashboard** - Overview of your listening activity in Indiekit's admin UI\n- **Now Playing Widget** - Shows currently playing or recently played tracks\n- **Listening History** - Browse your listening history with album art\n- **Favorites** - Display your favorite tracks\n- **Statistics** - View listening stats (plays, unique tracks, unique artists)\n- **Background Sync** - Automatically syncs listening data to MongoDB\n- **Public JSON API** - For integration with static site generators like Eleventy\n\n## Configuration\n\nAdd to your `indiekit.config.js`:\n\n```javascript\nimport FunkwhaleEndpoint from \"@rmdes/indiekit-endpoint-funkwhale\";\n\nexport default {\n  plugins: [\n    new FunkwhaleEndpoint({\n      mountPath: \"/funkwhale\",\n      instanceUrl: process.env.FUNKWHALE_INSTANCE,\n      username: process.env.FUNKWHALE_USERNAME,\n      token: process.env.FUNKWHALE_TOKEN,\n      cacheTtl: 900_000,      // 15 minutes\n      syncInterval: 300_000,  // 5 minutes\n      limits: {\n        listenings: 20,\n        favorites: 20,\n        topArtists: 10,\n        topAlbums: 10\n      }\n    }),\n  ],\n};\n```\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `FUNKWHALE_INSTANCE` | Yes | Your Funkwhale instance URL (e.g., `https://funkwhale.example.com`) |\n| `FUNKWHALE_TOKEN` | Yes | API access token (Bearer token) |\n| `FUNKWHALE_USERNAME` | Yes | Your username on the Funkwhale instance |\n\n### Getting an API Token\n\n1. Log in to your Funkwhale instance\n2. Go to Settings \u003e Applications\n3. Create a new application with read permissions\n4. Copy the access token\n\n## Routes\n\n### Admin Routes (require authentication)\n\n| Route | Description |\n|-------|-------------|\n| `GET /funkwhale/` | Dashboard overview with stats, recent plays, favorites |\n| `POST /funkwhale/sync` | Trigger manual sync |\n\n### Public API Routes (JSON)\n\nThese endpoints are publicly accessible and can be used by static site generators like Eleventy to display listening activity on your site.\n\n| Route | Description |\n|-------|-------------|\n| `GET /funkwhale/api/now-playing` | Current/recent track |\n| `GET /funkwhale/api/listenings` | Recent listenings |\n| `GET /funkwhale/api/favorites` | Favorites list |\n| `GET /funkwhale/api/stats` | All statistics (summary, top artists, top albums) |\n| `GET /funkwhale/api/stats/trends` | Trend data for charts (30 days) |\n\n### Example: Eleventy Integration\n\nFetch data from the public API in your Eleventy `_data` file:\n\n```javascript\n// _data/funkwhale.js\nimport EleventyFetch from \"@11ty/eleventy-fetch\";\n\nexport default async function() {\n  const baseUrl = process.env.SITE_URL || \"https://example.com\";\n\n  const [nowPlaying, listenings, stats] = await Promise.all([\n    EleventyFetch(`${baseUrl}/funkwhale/api/now-playing`, { duration: \"15m\", type: \"json\" }),\n    EleventyFetch(`${baseUrl}/funkwhale/api/listenings`, { duration: \"15m\", type: \"json\" }),\n    EleventyFetch(`${baseUrl}/funkwhale/api/stats`, { duration: \"15m\", type: \"json\" }),\n  ]);\n\n  return { nowPlaying, listenings, stats };\n}\n```\n\n## Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `mountPath` | `/funkwhale` | URL path for the endpoint |\n| `instanceUrl` | - | Funkwhale instance URL |\n| `token` | - | API access token |\n| `username` | - | User to track |\n| `cacheTtl` | `900000` | Cache TTL in ms (15 min) |\n| `syncInterval` | `300000` | Background sync interval in ms (5 min) |\n| `limits.listenings` | `20` | Listenings per page |\n| `limits.favorites` | `20` | Favorites per page |\n| `limits.topArtists` | `10` | Top artists to show |\n| `limits.topAlbums` | `10` | Top albums to show |\n\n## Now Playing Logic\n\n- **Now Playing**: Track listened to within the last 60 minutes\n- **Recently Played**: Track listened to within the last 24 hours\n- **Last Played**: Older tracks show timestamp only\n\n## Requirements\n\n- Indiekit \u003e= 1.0.0-beta.25\n- MongoDB (for statistics aggregation and sync)\n- Funkwhale instance with API v2\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmdes%2Findiekit-endpoint-funkwhale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmdes%2Findiekit-endpoint-funkwhale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmdes%2Findiekit-endpoint-funkwhale/lists"}