Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/spotify

src/exports/get-top-items.ts

12 lines · 471 B · TypeScript
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)
}