Skip to main content

Function: useEnrichment()

useEnrichment(uri, options): UseQueryResult<{ available: boolean; enrichment: null | { citationCount: number; concepts: object[]; influentialCitationCount: number; lastEnrichedAt: string; openAlexId: string; referencesCount: number; semanticScholarId: string; topics: object[]; uri: string; }; }, Error>

Defined in: web/lib/hooks/use-discovery.ts:233

Fetches enrichment data for a preprint.

Parameters

uri

string

AT-URI of the preprint

options

UseEnrichmentOptions = {}

Query options

Returns

UseQueryResult<{ available: boolean; enrichment: null | { citationCount: number; concepts: object[]; influentialCitationCount: number; lastEnrichedAt: string; openAlexId: string; referencesCount: number; semanticScholarId: string; topics: object[]; uri: string; }; }, Error>

Query result with enrichment data

Remarks

Returns external IDs, citation counts, and concept/topic data from Semantic Scholar and OpenAlex.

Example

const { data } = useEnrichment('at://did:plc:abc/pub.chive.preprint/123');

if (data?.available && data.enrichment) {
console.log(`Citation count: ${data.enrichment.citationCount}`);
}