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

    Function getMe

    • Fetch the authenticated user's own profile (/me).

      Requires a valid user access token in config.token. This is an authenticated endpoint — it will fail without a user token.

      Parameters

      Returns Promise<SoundCloudMe>

      // app/dashboard/page.tsx
      import { getMe, scCacheKeys } from "soundcloud-api-ts-next/server";
      import { cookies } from "next/headers";

      export default async function DashboardPage() {
      const token = cookies().get("sc_access_token")?.value;
      if (!token) redirect("/login");

      const me = await getMe({
      clientId: process.env.SC_CLIENT_ID!,
      clientSecret: process.env.SC_CLIENT_SECRET!,
      token,
      }, { revalidate: 300, tags: scCacheKeys.me() });

      return <Dashboard user={me} />;
      }