Files
musicshare/apps/api/.env.example
T
chrisandClaude Opus 5.5 ca97f1c3ac Add Apple Music, Last.fm sign-in, and a fallback for Spotify's account cap
- Apple Music: sign MusicKit developer tokens (ES256 via node:crypto),
  accept the Music User Token from the iOS app, and poll recently played.
  Apple has no now-playing API or play timestamps, so a new top song is
  shown as playing for its length; connecting records a baseline so an
  old song isn't announced as current
- Last.fm web auth ("Sign in with Last.fm") instead of typing a
  username; session key stored encrypted
- Spotify accounts rejected by the 5-user development cap are sent back
  with error=spotify_limited instead of a 500, so apps can offer
  Spotify via Last.fm

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
2026-10-04 07:12:19 -04:00

31 lines
1.3 KiB
Bash

DATABASE_URL=postgres://musicshare:musicshare@localhost:5447/musicshare
REDIS_URL=redis://localhost:6380
PORT=4000
# Where the web app lives (CORS + post-OAuth redirects)
WEB_URL=http://localhost:3737
# Public base URL of this API, used for OAuth redirect URIs.
# Spotify requires a loopback IP (not "localhost") for http redirect URIs.
API_PUBLIC_URL=http://127.0.0.1:4000
COOKIE_SECURE=false
# 32 random bytes, base64. Generate with: openssl rand -base64 32
TOKEN_ENCRYPTION_KEY=
# https://developer.spotify.com/dashboard (redirect URI: $API_PUBLIC_URL/connections/spotify/callback)
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
# https://www.last.fm/api/account/create
LASTFM_API_KEY=
# Shared secret from the same Last.fm API account; enables one-tap "Sign in with Last.fm"
LASTFM_SHARED_SECRET=
# song.link API key (request at https://odesli.co). Enables YouTube Music/TIDAL links; without it those fall back to search.
ODESLI_API_KEY=
# Stable identifier for this app in Plex's auth flow
PLEX_CLIENT_ID=musicshare-dev
# Let users connect Jellyfin/Plex servers on private networks (LAN). Never enable in a hosted deployment.
ALLOW_PRIVATE_SERVER_URLS=false
# Apple Music: Apple Developer → Certificates, IDs & Profiles → Keys → new key with MusicKit enabled.
# Paste the .p8 contents with newlines as \n.
APPLE_TEAM_ID=
APPLE_MUSICKIT_KEY_ID=
APPLE_MUSICKIT_PRIVATE_KEY=