OptionalcacheSet Cache-Control headers on GET responses, keyed by route prefix.
Use "default" as a fallback for unmatched prefixes.
SoundCloud OAuth client ID from your app registration.
SoundCloud OAuth client secret from your app registration.
OptionalcorsCORS configuration. When set, Access-Control-Allow-Origin and
Access-Control-Allow-Methods headers are added to responses.
Optionalmethods?: string[]Allowed HTTP methods (default: inherited from your route exports).
Optionalorigin?: string | string[]Allowed origin(s). Pass a string or array of strings.
OptionalcsrfWhen true, POST/DELETE mutation routes (like, repost, follow) require a matching
Origin header. If cors.origin is also set, the Origin must match an allowed origin.
Helps prevent CSRF on action endpoints. Default: false.
OptionalgetCustom token provider for public (non-auth) routes. When set, this function is called instead of the default client-credentials flow. Useful when your app stores OAuth tokens externally (e.g. Redis, database).
A valid SoundCloud access token string.
OptionalonPassed through to the underlying SoundCloud API calls for per-request telemetry. Fires for each individual SoundCloud API request (including retries).
OptionalonCalled after every API route is handled with route-level telemetry. Use for logging, metrics, or observability on the Next.js side.
OptionalredirectOAuth redirect URI — required if using authentication features (login/callback).
OptionalroutesSelective route exposure. Use allowlist to only expose specific route prefixes,
or denylist to block specific ones. Unlisted routes return 403 when allowlist is set.
Optionalallowlist?: string[]Only expose these route prefixes (e.g. ["tracks", "search"]).
Optionaldenylist?: string[]Block these route prefixes (e.g. ["me", "likes"]).
Configuration for initializing server-side SoundCloud API route handlers.
Example
See
createSoundCloudRoutes for usage