Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Review feedback suggested using instance() from @/api for Discogs/Wikidata/MusicBrainz API calls. However, instance() is Spotify-specific with OAuth token refresh and Spotify base URL hardcoded.

Current Implementation (Correct)

  • External APIs use dedicated ky.create() instances with appropriate auth:
    • Discogs: Authorization: Discogs token=${DISCOGS_TOKEN}
    • Wikidata/MusicBrainz: User-Agent only
  • Repository guidelines specify instance() for "Spotify API calls" specifically

No Changes Required
The existing pattern correctly isolates external API concerns. Using instance() would leak Spotify OAuth headers to third-party services.

// ✓ Correct - dedicated client for external API
const discogsClient = ky.create({
  headers: { Authorization: `Discogs token=${DISCOGS_TOKEN}` },
  prefixUrl: DISCOGS_API_URL,
});

// ✗ Wrong - would add Spotify OAuth to Discogs requests
const { data } = await instance().get(...)

Awaiting confirmation this pattern is acceptable before closing.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Address feedback on Discogs and Wikipedia/Wikidata support PR Clarify external API pattern does not require instance() wrapper Dec 9, 2025
Copilot AI requested a review from BeardedBear December 9, 2025 22:15
@BeardedBear BeardedBear closed this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants