Returns the repositories this user committed to, with commit counts, using the GitHub GraphQL API.
POST https://api.github.com/graphql
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Array of repositories with their commit contribution counts
Fetches the contribution calendar for this user using the GitHub GraphQL API.
Returns the same data that powers GitHub's annual contribution map (the green squares heatmap on a user's profile), including a count and color per day.
Requires a token with the read:user scope.
POST https://api.github.com/graphql
Optionalparams: ContributionMapParamsOptional from / to ISO 8601 DateTime strings.
When omitted, GitHub defaults to the past year.
Optionalsignal: AbortSignalThe contribution calendar with weekly buckets of daily counts
const calendar = await gh.user('octocat').contributionMap();
console.log(calendar.totalContributions);
const days = calendar.weeks.flatMap(w => w.contributionDays);
// [{ date: '2024-01-01', contributionCount: 3, color: '#216e39' }, ...]
// Specific date range
const q1 = await gh.user('octocat').contributionMap({
from: '2024-01-01T00:00:00Z',
to: '2024-03-31T23:59:59Z',
});
Fetches the users following this user.
GET /users/{username}/followers
Optionalparams: { page?: number; per_page?: number }Optionalsignal: AbortSignalA paged response of users
Fetches the users this user is following.
GET /users/{username}/following
Optionalparams: { page?: number; per_page?: number }Optionalsignal: AbortSignalA paged response of users
Fetches the user details.
GET /users/{username}
Optionalsignal: AbortSignalThe user object
Returns the repositories this user opened issues in, with issue counts, using the GitHub GraphQL API.
POST https://api.github.com/graphql
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Array of repositories with their issue contribution counts
Lists public organizations for this user.
GET /users/{username}/orgs
Optionalparams: { page?: number; per_page?: number }Optionalsignal: AbortSignalA paged response of organizations
Returns the pinned items (repositories and gists) on this user's GitHub profile, using the GitHub GraphQL API.
Returns up to 6 items, matching what GitHub shows on a user's profile page.
POST https://api.github.com/graphql
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Array of pinned items — each is either a PinnedRepository or a PinnedGist
Lists public events performed by this user.
GET /users/{username}/events/public
Optionalparams: EventsParamsOptional pagination: per_page, page
Optionalsignal: AbortSignalA paged response of public events
Returns the repositories this user opened pull requests in, with PR counts, using the GitHub GraphQL API.
POST https://api.github.com/graphql
Optionalsignal: AbortSignalOptional AbortSignal to cancel the request
Array of repositories with their pull request contribution counts
Returns a RepositoryResource for a given repository under this user, providing access to all repository sub-resources.
The repository name
A chainable repository resource
Fetches public repositories for this user.
GET /users/{username}/repos
Optionalparams: ReposParamsOptional filters: type, sort, direction, per_page, page
Optionalsignal: AbortSignalA paged response of repositories
Lists the social accounts configured on this user's GitHub profile.
GET /users/{username}/social_accounts
Optionalsignal: AbortSignalArray of social accounts with provider and url fields
Allows the resource to be awaited directly, resolving with the user info. Delegates to UserResource.get.
Optionalonfulfilled: null | (value: GitHubUser) => TResult1 | PromiseLike<TResult1>Optionalonrejected: null | (reason: unknown) => TResult2 | PromiseLike<TResult2>
Represents a GitHub user resource with chainable async methods.
Implements
PromiseLike<GitHubUser>so it can be awaited directly to fetch user info, while also exposing sub-resource methods.Example