Skip to content
← Public packages

@kody/spotify

Read a Spotify profile, search the catalog, and manage library, playlists, devices, and playback.

FollowFork

Files

play-context.ts

17 lines · 596 B · TypeScript
import { playContext } from '../lib/spotify-api.ts'
import type { PlayContextParams } from '../lib/export-types.ts'

/**
 * Start playback of a Spotify album, playlist, or artist context URI.
 * Prefer `deviceName` when targeting a device. Supports `dryRun: true`.
 * @example
 * import playContext from 'kody:@kody/spotify/play-context'
 * await playContext({
 *   contextUri: 'spotify:playlist:37i9dQZF1DX0XUsuxWHRQd',
 *   deviceName: 'Living Room',
 *   dryRun: true,
 * })
 */
export default async function spotifyPlayContext(params: PlayContextParams) {
	return await playContext(params)
}