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

    Function useRepost

    • Repost or unrepost a SoundCloud track. Requires authentication.

      Returns {
          error: Error | null;
          loading: boolean;
          repostTrack: (trackId: string | number) => Promise<void>;
          unrepostTrack: (trackId: string | number) => Promise<void>;
      }

      An object with repostTrack, unrepostTrack, loading, and error.

      import { useRepost } from "soundcloud-api-ts-next";

      function RepostButton({ trackId }: { trackId: number }) {
      const { repostTrack, loading } = useRepost();
      return (
      <button onClick={() => repostTrack(trackId)} disabled={loading}>
      🔁 Repost
      </button>
      );
      }