soundcloud-api-ts-next
    Preparing search index...

    Function getUser

    • Fetch a SoundCloud user profile by ID.

      Uses client credentials (public endpoint — no user token required).

      Parameters

      • id: string | number

        User ID (number or string).

      • config: ServerHelperConfig

        SoundCloud client credentials.

      • OptionalcacheOptions: CacheOptions

        Optional next/cache caching options.

      Returns Promise<SoundCloudUser>

      // 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} />;
      }