Skip to content

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

Package listing

@kody/spotify

src/exports/transfer-playback.ts

14 lines · 586 B · TypeScript
import { transferPlayback } from '../lib/spotify-api.ts'
import type { TransferPlaybackParams } from '../lib/export-types.ts'

/**
 * Transfer Spotify playback to another Connect device.
 * Prefer `deviceName` (and optional `deviceType`) over raw `deviceId`.
 * Supports `dryRun: true`.
 * @example
 * import transferPlayback from 'kody:@kody/spotify/transfer-playback'
 * await transferPlayback({ deviceName: 'Living Room', play: true, dryRun: true })
 */
export default async function spotifyTransferPlayback(params: TransferPlaybackParams) {
	return await transferPlayback(params)
}