Home Reference Source
public class | source

Api

Fetch KKBOX resources.

Constructor Summary

Public Constructor
public

constructor(token: string, territory: string)

Need access token to initialize.

Member Summary

Public Members
public
public
public
public
public
public
public
public
public
public
public
public
public
public

Method Summary

Public Methods
public

setToken(token: string)

Set new token and create fetchers with the new token.

Public Constructors

public constructor(token: string, territory: string) source

Need access token to initialize.

Params:

NameTypeAttributeDescription
token string

Get via Auth.

territory string
  • optional
  • default: 'TW'

['TW', 'HK', 'SG', 'MY', 'JP'] The territory for the fetcher.

Example:

new Api(token);
new Api(token, 'TW');

Public Members

public albumFetcher: AlbumFetcher source

public artistFetcher: ArtistFetcher source

public chartFetcher: ChartFetcher source

public featuredPlaylistCategoryFetcher: FeaturedPlaylistCategoryFetcher source

public featuredPlaylistFetcher: FeaturedPlaylistFetcher source

public genreStationFetcher: GenreStationFetcher source

public httpClient: * source

public moodStationFetcher: MoodStationFetcher source

public newHitsPlaylistFetcher: NewHitsPlaylistFetcher source

public newReleaseCategoryFetcher: NewReleaseCategoryFetcher source

public searchFetcher: SearchFetcher source

public sharedPlaylistFetcher: SharedPlaylistFetcher source

public territory: * source

public trackFetcher: TrackFetcher source

Public Methods

public setToken(token: string) source

Set new token and create fetchers with the new token.

Params:

NameTypeAttributeDescription
token string

Get via Auth.

Example:

api.setToken(token);