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

    Variable scFetchersConst

    scFetchers: {
        me(token: string): Promise<SoundCloudMe>;
        meConnections(token: string): Promise<SoundCloudConnection[]>;
        meFeed(
            token: string,
            limit?: number,
        ): Promise<SoundCloudActivitiesResponse>;
        meRecentlyPlayed(token: string): Promise<SoundCloudTrack[]>;
        playlist(id: string | number, token?: string): Promise<SoundCloudPlaylist>;
        relatedTracks(
            trackId: string | number,
            token?: string,
        ): Promise<SoundCloudTrack[]>;
        relatedUsers(
            userId: string | number,
            token?: string,
        ): Promise<SoundCloudPaginatedResponse<SoundCloudUser>>;
        resolve(url: string, token?: string): Promise<unknown>;
        searchTracks(
            q: string,
            limit?: number,
            token?: string,
        ): Promise<SoundCloudPaginatedResponse<SoundCloudTrack>>;
        searchUsers(
            q: string,
            limit?: number,
            token?: string,
        ): Promise<SoundCloudPaginatedResponse<SoundCloudUser>>;
        track(id: string | number, token?: string): Promise<SoundCloudTrack>;
        tracks(
            ids: (string | number)[],
            token?: string,
        ): Promise<SoundCloudTrack[]>;
        user(id: string | number, token?: string): Promise<SoundCloudUser>;
    } = ...

    Headless async fetchers for SoundCloud resources.

    These are plain async functions with no React dependency — designed for use with TanStack Query, SWR, or any other caching/fetching layer.

    Configure once with configureFetchers, then use these as queryFn / fetcher callbacks alongside the matching scKeys query key factories.

    Type Declaration

    // TanStack Query
    const { data } = useQuery({
    queryKey: scKeys.track(id),
    queryFn: () => scFetchers.track(id),
    });

    // SWR
    const { data } = useSWR(scKeys.track(id), () => scFetchers.track(id));