← Public packages
@kody/spotify
Read a Spotify profile, search the catalog, and manage library, playlists, devices, and playback.
Files
import { getTopItems } from '../lib/spotify-api.ts'
import type { GetTopItemsParams } from '../lib/export-types.ts'
/**
* Read the user's top Spotify tracks or artists for a time range.
* @example
* import getTopItems from 'kody:@kody/spotify/get-top-items'
* const tracks = await getTopItems({ type: 'tracks', timeRange: 'short_term', limit: 5 })
*/
export default async function spotifyGetTopItems(params: GetTopItemsParams) {
return await getTopItems(params)
}