Spotify Tokener Service
Custom token endpoint and Partner API bridge for high-speed Spotify track resolution in Lavalink.
Official Service: https://spotify.musiva.app/
Token Endpoint: https://spotify.musiva.app/api/getToken
Spotify Tokener is a dedicated service designed to generate and supply anonymous client tokens to Lavalink. This allows Lavalink to query the Spotify Partner API directly, resolving track titles, artists, album artwork, and ISRC codes without relying on official developer API quotas.
Direct URL Resolution Flow
When a user submits a direct Spotify track, album, or playlist link in Discord (!play https://open.spotify.com/track/...), the Musiva backend does not spend time resolving the Spotify track data itself.
Instead, the workflow is streamlined:
User Submits Spotify Link
↓
Musiva Backend (Forwards raw URL)
↓
Lavalink Server
↓
Queries Spotify Tokener (https://spotify.musiva.app/api/getToken)
↓
Retrieves Anonymous Partner Access Token
↓
Lavalink Resolves Track Metadata via Spotify Partner API
↓
Matches ISRC to Lossless Provider (Deezer / Apple / YouTube)Lavalink Configuration
In your Lavalink application.yml, the lavasrc plugin is configured to consume the custom token endpoint with the Partner API flag enabled:
plugins:
lavasrc:
spotify:
clientId: "YOUR_SPOTIFY_CLIENT_ID"
clientSecret: "YOUR_SPOTIFY_CLIENT_SECRET"
countryCode: "US"
customTokenEndpoint: "https://spotify.musiva.app/api/getToken"
preferPartnerApi: true
preferV1SearchApi: false
resolveArtistsInSearch: true
albumLoadLimit: 6
playlistLoadLimit: 6
localFiles: falseKey Parameters
customTokenEndpoint: Points directly to Musiva's token rotation microservice.preferPartnerApi: true: Tells Lavalink to prioritize the internal Spotify Web Player Partner API rather than standard Web API endpoints.
Separation of Spotify Credentials
Musiva strictly isolates credentials between Lavalink audio processing and the WebPlayer frontend:
1. Lavalink Path
- Relies on Spotify Tokener and the Partner API.
- Bypasses the strict rate limits and playlist pagination caps imposed by the official Spotify Developer Portal.
2. Backend & WebPlayer Path
- Uses official Spotify Developer App Credentials (
clientId&clientSecret). - Handles user profile authentication, saved playlists, and official WebPlayer analytics.
This dual-track architecture guarantees that heavy track resolution workloads on the bot cluster never consume the rate limits required by the WebPlayer dashboard.