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-profile.ts

15 lines · 612 B · TypeScript
import { getCurrentProfile } from '../lib/spotify-api.ts'
import type { GetProfileParams } from '../lib/export-types.ts'

/**
 * Read the connected Spotify user profile.
 * Pass `integration` for a non-default `spotify-*` connection.
 * @returns id, displayName, product, country, url, and followers.
 * @example
 * import getProfile from 'kody:@kody/spotify/get-profile'
 * const me = await getProfile()
 * // => { integration: 'spotify', id: '...', displayName: '...', product: 'premium' }
 */
export default async function getProfile(params: GetProfileParams = {}) {
	return await getCurrentProfile(params)
}