A SoundCloud URL to resolve. Pass undefined to skip the request.
Hook result with the resolved resource as data, plus loading and error states.
import { useResolve } from "soundcloud-api-ts-next";
function ResolvedResource({ scUrl }: { scUrl: string }) {
const { data, loading, error } = useResolve(scUrl);
if (loading) return <p>Resolving...</p>;
if (error) return <p>Error: {error.message}</p>;
return <pre>{JSON.stringify(data, null, 2)}</pre>;
}
Resolve a SoundCloud URL to an API resource.
Pass a full SoundCloud URL (e.g.
https://soundcloud.com/deadmau5/strobe) and get back the resolved API resource (track, user, or playlist object).