The portfolio has two optional live-data cards. Neither integration invents fallback statistics or tracks: when a connection is absent, the UI says setup is pending.
The section is disabled by default. After both integrations are configured, set VITE_ENABLE_LIVE_ACTIVITY=true in Netlify and redeploy. Until then, neither the Activity navbar link nor the section is rendered.
WakaTime explicitly recommends not using a secret API key on a public website. This portfolio uses its public embeddable JSON share through a same-origin normalizing function.
-
Create or sign into a WakaTime account.
-
Install the official WakaTime VS Code extension.
-
Follow the extension prompt to connect the account. The WakaTime API key belongs in VS Code only; do not put it in this repository or send it in chat.
-
Write code normally so WakaTime has activity to report.
-
Open WakaTime Share, create a Coding Activity share, and choose JSON.
-
Copy the resulting public URL, which resembles:
https://wakatime.com/share/@username/share-id.json -
Add that URL to Netlify as
WAKATIME_SHARE_URL.
The public share URL is not the secret API key. The server function validates that it uses HTTPS, belongs to wakatime.com, and starts with /share/. It returns only the latest seven daily totals, weekly total, and daily average.
Spotify requires user authorization. The browser never receives the client secret, refresh token, or temporary access token.
-
Open the Spotify Developer Dashboard and create an application.
-
Add this redirect URI exactly:
http://127.0.0.1:8888/callback -
Copy
.env.exampleto.env.local. -
Put the app credentials into
.env.local:SPOTIFY_CLIENT_ID=... SPOTIFY_CLIENT_SECRET=...
-
Run:
npm run spotify:authorize
-
Open the URL printed by the script and approve these read-only scopes:
user-read-currently-playinguser-read-recently-played
-
The helper saves the refresh token directly to ignored
.env.localwith owner-only file permissions. It does not print the token. -
Add all three Spotify values from
.env.localdirectly to the Netlify site’s environment variables.
Never send the client secret or refresh token through chat, email, screenshots, commits, or frontend variables. In particular, do not prefix them with VITE_.
npm run dev runs Vite only, so the cards show their honest connection-pending states. To exercise Netlify Functions locally after configuration, use the Netlify CLI:
npx netlify-cli devReturns one of:
200 { "status": "ok", ...sanitized activity }200 { "status": "empty" }503 { "status": "unconfigured" }502 { "status": "unavailable" }
Returns one of:
200 { "status": "playing", "track": ... }200 { "status": "recent", "track": ... }200 { "status": "empty" }503 { "status": "unconfigured" }502 { "status": "unavailable" }
Only track title, artists, album, allowlisted artwork/link URLs, playback state, duration, and last-played timestamp can reach the browser.