Skip to main content

Function: useBacklinkCounts()

useBacklinkCounts(targetUri, options): UseQueryResult<BacklinkCounts, Error>

Defined in: web/lib/hooks/use-backlinks.ts:166

Fetches aggregated backlink counts for a preprint.

Parameters

targetUri

string

AT URI of the preprint to get counts for

options

UseBacklinkCountsOptions = {}

Query options

Returns

UseQueryResult<BacklinkCounts, Error>

Query result with backlink counts

Remarks

Returns counts by source type (Semble, Bluesky, WhiteWind, Leaflet, etc.) and a total count. Useful for displaying summary badges.

Example

const { data: counts, isLoading } = useBacklinkCounts(preprintUri);
console.log(counts?.total, 'total backlinks');