Skip to content

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

Package listing

@kody/spotify

src/exports/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)
}