DocsReact HooksuseProfileDetails

useProfileDetails

The useProfileDetails hook fetches and manages the profile details for a given Ethereum address or ENS name, including ENS data and primary list information.

Add to your project

import { useProfileDetails } from 'ethereum-identity-kit'
 
export default function ProfileComponent() {
  const { ens, address, primaryList, detailsLoading, refreshProfileDetails } = useProfileDetails({
    addressOrName: 'vitalik.eth',
  })
 
  if (detailsLoading) return <div>Loading...</div> // Create your own loading states
 
  // --- Your component code here ---
}

Parameters

ParameterDescriptionRequiredDefault Value
addressOrNameEthereum Address or ENS name to fetch profile details for.Yes-
listList number to fetch profile details for; overrides addressOrName if provided.No-
prefetchedDataPrefetched profile data to use initially.No-
refetchPrefetchedDataFunction to refetch prefetched profile data.No-

Return Values

Return ValueDescription
ensENS data for the profile, including name and records.
addressEthereum address associated with the profile.
primaryListPrimary list number associated with the profile.
detailsLoadingBoolean indicating if the profile details are currently loading.
refreshProfileDetailsFunction to manually refresh the profile details.