Skip to main content

Function: useAuthorMetrics()

useAuthorMetrics(did): UseQueryResult<{ hIndex: number; totalDownloads: number; totalEndorsements: number; totalPreprints: number; totalReviews: number; totalViews: number; }, Error>

Defined in: web/lib/hooks/use-author.ts:162

Fetches author metrics separately.

Parameters

did

string

The author's DID

Returns

UseQueryResult<{ hIndex: number; totalDownloads: number; totalEndorsements: number; totalPreprints: number; totalReviews: number; totalViews: number; }, Error>

Query result with author metrics

Remarks

Uses the same endpoint as useAuthor but extracts only metrics. Shares cache with useAuthor when called with the same DID.

Example

const { data: metrics } = useAuthorMetrics('did:plc:abc123');

if (metrics) {
console.log(`h-index: ${metrics.hIndex}`);
}