Skip to content

fetchRepo

The fetcher behind the repository pin card.

Fetch repository data.

fetchRepo(options, config: CardConfig): Promise<RepositoryData>
OptionTypeRequiredWhat it is
usernamestring | undefinedyes—
reponamestring | undefinedyes—
searchesreadonly ("issues_commented" | "issues_opened" | "prs_commented" | "prs_opened" | "prs_reviewed")[] | undefinednoThe search-based counts to fetch, within this repository.
include_topicsboolean | undefinedno—

Returns Promise<RepositoryData> — Repository data.

repo may carry the owner itself — octocat/hello-world — in which case it wins over username. That is what lets one option name any repository, rather than only one of the user’s own.

Each entry of searches — prs_opened, prs_commented, prs_reviewed, issues_opened or issues_commented — adds a search request, scoped to this repository rather than to the user.

include_topics asks the same request for the repository’s topics, returned as topics, their names in GitHub’s order.