soundcloud-api-ts - v1.13.4
    Preparing search index...

    Interface SoundCloudClientConfig

    Configuration options for creating a SoundCloudClient instance.

    interface SoundCloudClientConfig {
        cache?: SoundCloudCache;
        cacheTtlMs?: number;
        clientId: string;
        clientSecret: string;
        dedupe?: boolean;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        maxRetries?: number;
        onDebug?: (message: string) => void;
        onRequest?: (telemetry: SCRequestTelemetry) => void;
        onRetry?: (info: RetryInfo) => void;
        onTokenRefresh?: (client: SoundCloudClient) => Promise<SoundCloudToken>;
        redirectUri?: string;
        retryBaseDelay?: number;
    }
    Index

    Properties

    Optional cache backend for API responses

    cacheTtlMs?: number

    Default TTL in milliseconds for cached responses (default: 60000)

    clientId: string

    Your SoundCloud application's OAuth client ID

    clientSecret: string

    Your SoundCloud application's OAuth client secret

    dedupe?: boolean

    Deduplicate concurrent identical requests (default: true)

    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Custom fetch implementation (defaults to globalThis.fetch)

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    maxRetries?: number

    Maximum number of retries on 429 (rate limit) and 5xx (server error) responses (default: 3)

    onDebug?: (message: string) => void

    Optional debug logger callback for retry attempts and other internal events

    onRequest?: (telemetry: SCRequestTelemetry) => void

    Called after every API request with structured telemetry (timing, status, retries)

    onRetry?: (info: RetryInfo) => void

    Called before each retry attempt with structured retry info

    onTokenRefresh?: (client: SoundCloudClient) => Promise<SoundCloudToken>

    Called automatically when a request returns 401 Unauthorized. Return new tokens to transparently retry the failed request.

    redirectUri?: string

    OAuth redirect URI registered with your SoundCloud application (required for user auth flows)

    retryBaseDelay?: number

    Base delay in milliseconds for exponential backoff between retries (default: 1000)