SoundCloud API credentials and optional redirect URI.
An object with route handlers and direct API methods.
Optionallimit: numberApp Router catch-all handler.
Mount at app/api/soundcloud/[...route]/route.ts
Pages Router catch-all handler.
Mount at pages/api/soundcloud/[...route].ts
Individual route handlers
Optionalpage: number// app/api/soundcloud/[...route]/route.ts
import { createSoundCloudRoutes } from "soundcloud-api-ts-next/server";
const sc = createSoundCloudRoutes({
clientId: process.env.SC_CLIENT_ID!,
clientSecret: process.env.SC_CLIENT_SECRET!,
redirectUri: "http://localhost:3000/api/soundcloud/auth/callback",
});
const handle = sc.handler();
export const GET = handle;
export const POST = handle;
export const DELETE = handle;
Create SoundCloud API route handlers for Next.js.
Returns an object with individual data-fetching methods (e.g.
searchTracks,getTrack) and catch-all handlers for App Router (handler()) and Pages Router (pagesHandler()). Manages client credential tokens automatically.