Playlist ID (number or string).
SoundCloud client credentials.
OptionalcacheOptions: CacheOptionsOptional next/cache caching options.
// app/playlists/[id]/page.tsx
import { getPlaylist, scCacheKeys } from "soundcloud-api-ts-next/server";
export default async function PlaylistPage({ params }: { params: { id: string } }) {
const playlist = await getPlaylist(params.id, {
clientId: process.env.SC_CLIENT_ID!,
clientSecret: process.env.SC_CLIENT_SECRET!,
}, { revalidate: 1800, tags: scCacheKeys.playlist(params.id) });
return <PlaylistView playlist={playlist} />;
}
Fetch a SoundCloud playlist by ID.
Uses client credentials (public endpoint — no user token required).