<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MMM-NowPlayingOnSpotify: surviving Spotify&#x27;s 6-month refresh-token expiry (a maintained   fork)]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">if you use MMM-NowPlayingOnSpotify (raywo’s lovely “now playing” module), there’s a<br />
change coming from Spotify that will quietly break it — and I wanted to share both the<br />
problem and a fix.</p>
<p dir="auto">The problem</p>
<p dir="auto">Spotify announced that, starting 20 July 2026, user refresh tokens will expire after 6<br />
months (blog (<a href="https://developer.spotify.com/blog/2026-06-18-refresh-token-expiration" target="_blank" rel="noopener noreferrer nofollow ugc">https://developer.spotify.com/blog/2026-06-18-refresh-token-expiration</a>)).<br />
Until now those tokens were effectively permanent, so the module just stored one and<br />
kept minting access tokens forever. Once a refresh token expires, Spotify returns an<br />
invalid_grant error, and the app is expected to discard it and send the user through<br />
the sign-in flow again.</p>
<p dir="auto">The original module doesn’t handle that case: it logs the error and silently falls back<br />
to the “nothing is playing” logo. So one day your mirror would just… stop showing<br />
songs, with no hint why — while hammering the API once per second with a dead token.</p>
<p dir="auto">First attempt: the polite way</p>
<p dir="auto">I opened an issue on the original repo to flag it. Unfortunately the project has been<br />
unmaintained for ~6 years, and there was no response. So rather than let everyone’s<br />
module quietly die this summer, I forked it and did the work.</p>
<p dir="auto">The fix: a fork with proper token handling</p>
<p dir="auto">👉 <a href="https://github.com/rkorell/MMM-NowPlayingOnSpotify" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/rkorell/MMM-NowPlayingOnSpotify</a> (v2.0.0)</p>
<p dir="auto">What it does now:</p>
<ul>
<li>Detects invalid_grant, stops retrying, and shows a clear red re-authorization banner<br />
on the mirror instead of pretending nothing’s playing.</li>
<li>Proactive warning ~2 weeks before the hard expiry (a smaller banner above the cover<br />
art) — the music keeps playing, so it’s never a surprise outage.</li>
<li>Self-managed token store (tokens.json, git-ignored) instead of tokens in config.js,<br />
so rotated/renewed tokens are actually persisted. You only keep clientID, clientSecret<br />
and redirectURI in your config now.</li>
<li>Integrated re-authorization: the module runs a tiny local auth server; you<br />
re-authorize from a browser and it recovers in-process, no restart.</li>
<li>Under the hood: a full refactor to native fetch/http — the deprecated request/express<br />
dependencies are gone, so it’s now zero runtime dependencies — plus a proper backend<br />
poll loop and English/German translations.</li>
</ul>
<p dir="auto">One wrinkle worth knowing (loopback + SSH tunnel)</p>
<p dir="auto">Spotify only accepts http redirect URIs for loopback addresses now — a LAN IP or<br />
hostname over http is rejected at runtime as insecure, and localhost isn’t allowed<br />
either. So the redirect URI is <a href="http://127.0.0.1:8888/callback" target="_blank" rel="noopener noreferrer nofollow ugc">http://127.0.0.1:8888/callback</a>. Since a mirror is<br />
headless, the easiest way to re-authorize from your laptop is a one-line SSH tunnel:</p>
<pre><code>ssh -L 8888:127.0.0.1:8888 pi@&lt;mirror-ip&gt;
</code></pre>
<p dir="auto">…then open <a href="http://127.0.0.1:8888" target="_blank" rel="noopener noreferrer nofollow ugc">http://127.0.0.1:8888</a> in your laptop’s browser. Full details are in the<br />
README.</p>
<p dir="auto">Happy to help anyone getting it running, and a big thank-you to raywo for the original<br />
module that many of us have enjoyed for years.</p>
]]></description><link>https://forum.magicmirror.builders/topic/20291/mmm-nowplayingonspotify-surviving-spotify-s-6-month-refresh-token-expiry-a-maintained-fork</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 22:30:09 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/20291.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Jul 2026 11:56:34 GMT</pubDate><ttl>60</ttl></channel></rss>