Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Spotify AuthenticationNew to Visual Studio Code? Get it now.
Spotify Authentication

Spotify Authentication

Tyler Leonhardt

|
128 installs
| (0) | Free
Provides a VS Code Authentication Provider for Spotify
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Spotify Authentication

Provides a VS Code Authentication Provider for Spotify 🎶

Usage

Add this extension to your package.json:

"extensionDependencies": [
    "TylerLeonhardt.vscode-spotify-auth"
],

Then, in your extension, you can use the built-in auth API to authenticate with Spotify:

import * as vscode from 'vscode';

const exampleScopes = ['user-read-playback-state', 'user-modify-playback-state'];
const session = await vscode.authentication.getSession('spotify', exampleScopes, options);

This returns an AuthenticationSession object which actually includes a refresh token property as well:

export interface SpotifyAuthenticationSession extends AuthenticationSession {
    accessToken: string;
    refreshToken: string;
    expiresIn: number;
}

You can turn this into the @spotify/web-api-ts-sdk's AccessToken which looks like this:

export interface AccessToken {
    access_token: string;
    token_type: string;
    expires_in: number;
    refresh_token: string;
    expires?: number;
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft