Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8c7d2f9
feat(api): parse and expose commits_end_year and all_commits_api quer…
JesKei May 21, 2026
6ff9419
refactor(stats): extract shared GraphQL fields and introduce query wr…
JesKei May 22, 2026
b474a8e
feat(stats): implement dynamic year-aliasing query generator and acco…
JesKei May 22, 2026
849dc2c
refactor(stats): simplify fetcher to accept an optional external quer…
JesKei May 22, 2026
c5cffd8
feat(stats): extend fetchStats function signature with commits_end_ye…
JesKei May 22, 2026
8516a63
feat(stats): conditionally include restrictedContributionsCount in dy…
JesKei May 22, 2026
3edfa03
refactor(api): rename parameter to commits_api to match core naming u…
JesKei May 22, 2026
9bbedec
refactor(stats): rename parameter to commits_api and improve its JSDo…
JesKei May 22, 2026
2641029
refactor(stats): extract GraphQL error handling block into reusable h…
JesKei May 22, 2026
23b3b5f
feat(stats): expose query parameter through statsFetcher to support c…
JesKei May 22, 2026
895982b
refactor(stats): rename query generator function to generateAdvancedS…
JesKei May 22, 2026
b7e93ef
feat(stats): implement resolveAdvancedStatsQuery to handle advanced m…
JesKei May 22, 2026
000d82c
feat(stats): integrate resolveAdvancedStatsQuery and loop-summing int…
JesKei May 22, 2026
c8ebe08
style(stats): apply object shorthand to satisfy eslint rules in resol…
JesKei May 22, 2026
e7a3fc0
test(stats): implement error handling validation tests for advanced API
JesKei May 22, 2026
bba2e64
test(stats): add comprehensive unit tests for advanced commits_api an…
JesKei May 22, 2026
4761979
feat(commits): add DISABLE_ADVANCED_COMMITS feature toggle
JesKei May 30, 2026
5952dd7
refactor(commits): introduce commits API validator and strict type ch…
JesKei May 30, 2026
a7856d8
docs(readme): document advanced commits API and DISABLE_ADVANCED_COMM…
JesKei May 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export default async (req, res) => {
show_icons,
include_all_commits,
commits_year,
commits_end_year,
commits_api,
line_height,
title_color,
ring_color,
Expand Down Expand Up @@ -94,6 +96,8 @@ export default async (req, res) => {
showStats.includes("discussions_started"),
showStats.includes("discussions_answered"),
parseInt(commits_year, 10),
parseInt(commits_end_year, 10),
commits_api,
);
const cacheSeconds = resolveCacheSeconds({
requested: parseInt(cache_seconds, 10),
Expand Down
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ If we don't support your language, please consider contributing! You can find mo
| `hide_rank` | Hides the rank and automatically resizes the card width. | boolean | `false` |
| `rank_icon` | Shows alternative rank icon (i.e. `github`, `percentile` or `default`). | enum | `default` |
| `show_icons` | Shows icons near all stats. | boolean | `false` |
| `include_all_commits` | Count total commits instead of just the current year commits. | boolean | `false` |
| `commits_api` | API execution mode for the statistics card.<br /><br />Values:<br /> • `default` - default behavior (fetches data for the past year or for the specified year).<br /> • `advanced` - uses GraphQL API to fetch all-time public commits by default. Can be extended to include private repositories via `include_all_commits`, or filtered by specific years via `commits_year` and `commits_end_year`.<br /><br />_Note: The value is case-sensitive. If an invalid or unknown value is provided, it will safely fallback to the `default` behavior._ | enum | `default` |
| `include_all_commits` | Count total commits instead of just the current year commits.<br /><br />If `commits_api` is set to `advanced`, setting `include_all_commits` to `true` will include private commits in the total count as well. | boolean | `false` |
| `line_height` | Sets the line height between text. | integer | `25` |
| `exclude_repo` | Excludes specified repositories. | string (comma-separated values) | `null` |
| `custom_title` | Sets a custom title for the card. | string | `<username> GitHub Stats` |
Expand All @@ -384,14 +385,18 @@ If we don't support your language, please consider contributing! You can find mo
| `number_format` | Switches between two available formats for displaying the card values `short` (i.e. `6.6k`) and `long` (i.e. `6626`). | enum | `short` |
| `number_precision` | Enforce the number of digits after the decimal point for `short` number format. Must be an integer between 0 and 2. Will be ignored for `long` number format. | integer (0, 1 or 2) | `null` |
| `show` | Shows [additional items](#showing-additional-individual-stats) on stats card (i.e. `reviews`, `discussions_started`, `discussions_answered`, `prs_merged` or `prs_merged_percentage`). | string (comma-separated values) | `null` |
| `commits_year` | Filters and counts only commits made in the specified year. | integer _(YYYY)_ | `<current year> (one year to date)` |
| `commits_year` | Filters and counts only commits made in the specified year.<br /><br />If `commits_api` is set to `advanced`, this parameter filters commits for the specified year, or serves as the start year when paired with `commits_end_year`. | integer _(YYYY)_ | `<current year> (one year to date)` |
| `commits_end_year` | End year of the commits range.<br /><br />Works only in conjunction with `commits_year` and when `commits_api` is set to `advanced`. | integer _(YYYY)_ | `undefined` |

> [!WARNING]
> Custom title should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) (i.e: `Anurag's GitHub Stats` should become `Anurag%27s%20GitHub%20Stats`). You can use [urlencoder.org](https://www.urlencoder.org/) to help you do this automatically.

> [!NOTE]
> When hide\_rank=`true`, the minimum card width is 270 px + the title length and padding.

> [!NOTE]
> Set the `DISABLE_ADVANCED_COMMITS` environment variable to `true` to disable the `advanced` commits API mode globally. Although the advanced mode is highly optimized and fetches all data in a **single GraphQL request**, this toggle is provided as a safeguard to disable the feature if high-traffic instances hit strict GitHub API rate limits. When disabled, it safely falls back to the default behavior.

***

# GitHub Extra Pins
Expand Down
Loading