Exchange an OAuth authorization code for an access token with AniList.
Centralized helper to avoid duplicated token exchange logic and provide consistent error handling.
IMPORTANT: This helper assumes a runtime with a global fetch and AbortController (e.g., Electron main process
running a recent Node/Electron runtime). If your environment does not provide these globals, you can pass in
explicit implementations via the optional deps parameter.
Exchange an OAuth authorization code for an access token with AniList. Centralized helper to avoid duplicated token exchange logic and provide consistent error handling.
IMPORTANT: This helper assumes a runtime with a global
fetchandAbortController(e.g., Electron main process running a recent Node/Electron runtime). If your environment does not provide these globals, you can pass in explicit implementations via the optionaldepsparameter.