Retrieves the current Spotify access token
Gets the currently stored access token for API requests. Dynamically imports the token module to avoid circular dependencies.
This function:
Promise resolving to the access token or null if not authenticated
// Get token for API requestconst token = await getAccessToken();if (token) { headers.Authorization = `Bearer ${token}`; await makeApiRequest("/me", headers);} else { // Handle unauthenticated state showLoginPrompt();} Copy
// Get token for API requestconst token = await getAccessToken();if (token) { headers.Authorization = `Bearer ${token}`; await makeApiRequest("/me", headers);} else { // Handle unauthenticated state showLoginPrompt();}
export async function getAccessToken(): Promise<string | null> { const mod = await import("./storage/token-operations"); return mod.getAccessToken();} Copy
export async function getAccessToken(): Promise<string | null> { const mod = await import("./storage/token-operations"); return mod.getAccessToken();}
Retrieves the current Spotify access token
Gets the currently stored access token for API requests. Dynamically imports the token module to avoid circular dependencies.
This function: