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

    Function useUser

    • Fetch a single SoundCloud user profile by ID.

      Parameters

      • userId: string | number | undefined

        The SoundCloud user ID. Pass undefined to skip the request.

      Returns HookResult<SoundCloudUser>

      Hook result with data as a SoundCloudUser, plus loading and error states.

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

      function UserProfile({ id }: { id: number }) {
      const { data: user, loading } = useUser(id);
      if (loading) return <p>Loading...</p>;
      return <h1>{user?.username}</h1>;
      }