Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SpotifyWebApi

Hierarchy

  • SpotifyWebApi

Index

Constructors

constructor

Properties

albums

albums: AlbumsApi

artists

artists: ArtistsApi

browse

browse: BrowseApi

Private clientId

clientId: string

Private clientSecret

clientSecret: string

episodes

episodes: EpisodesApi

follow

follow: FollowApi

Private http

http: Http

library

library: LibraryApi

personalization

personalization: PersonalizationApi

player

player: PlayerApi

playlists

playlists: PlaylistsApi

Private redirectUri

redirectUri: string

search

search: SearchApi

shows

shows: ShowsApi

tracks

tracks: TracksApi

users

users: UsersApi

Methods

getAccessToken

  • getAccessToken(): string

getClientId

  • getClientId(): string

getClientSecret

  • getClientSecret(): string

getRedirectUri

  • getRedirectUri(): string

getRefreshableAuthorizationUrl

getRefreshableUserTokens

  • Get refreshable authorization tokens using the Authorization Code flow.

    This flow is suitable for long-running applications in which the user grants permission only once. It provides an access token that can be refreshed. Since the token exchange involves sending your secret key, perform this on a secure location, like a backend service, and not from a client such as a browser or from a mobile app.

    Parameters

    • code: string

      The authorization code returned from the initial request to the authorization endpoint.

    Returns Promise<GetRefreshableUserTokensResponse>

getRefreshedAccessToken

  • Obtain a refreshed access token given the original refresh token from the initial authorization code exchange.

    Parameters

    • refreshToken: string

      The refresh token returned from the authorization code exchange.

    Returns Promise<GetRefreshedAccessTokenResponse>

getTemporaryAppTokens

  • Get temporary authorization tokens using the Client Credentials flow.

    The Client Credentials flow is used in server-to-server authentication. Only endpoints that do not access user information can be accessed. The advantage here in comparison with requests to the Web API made without an access token, is that a higher rate limit is applied.

    Returns Promise<GetTemporaryAppTokensResponse>

getTemporaryAuthorizationUrl

  • Get an authorization URL for use with the Implicit Grant and Client Credentials flows.

    Parameters

    Returns string

setAccessToken

  • setAccessToken(accessToken: string): void
  • Parameters

    • accessToken: string

    Returns void

Generated using TypeDoc