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