Skip to main content

Function: useAuthorMetrics()

useAuthorMetrics(did): UseQueryResult<AuthorMetrics, Error>

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

Fetches author metrics separately.

Parameters

did

string

The author's DID

Returns

UseQueryResult<AuthorMetrics, 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}`);
}