The track ID to find related tracks for. Pass undefined to skip.
Hook result with data as an array of related SoundCloudTrack.
import { useRelatedTracks } from "soundcloud-api-ts-next";
function Related({ trackId }: { trackId: number }) {
const { data: tracks } = useRelatedTracks(trackId);
return <ul>{tracks?.map(t => <li key={t.id}>{t.title}</li>)}</ul>;
}
Fetch tracks related to a given SoundCloud track (recommendations).