GitHub Stats Widget

License: MIT
Built with JavaScript
Platform
Scriptable
Themes
Widget Sizes
iOS Widget

Track your GitHub stats — commits, contributions, streaks, PRs, issues, and repo insights — all beautifully displayed on your iOS home screen using Scriptable.

📌 Dynamic layouts for small, medium, and large widgets with theme support and GitHub API integration.


⚙️ Features

  • 🕒 Yearly commits and 🔥 streak tracking

  • 📦 Repo-specific stats: ⭐ stars, 👁 views, 🧮 total commits

  • 📜 All-time contributions, PRs, and issue counts

  • 🎨 Multiple theme presets (auto/dark/light/indigo/night/green/etc.)

  • 📐 Adaptive layouts for:

    • Small: condensed stat block

    • Medium: stat summary

    • Large: full grid layout

  • 📁 GitHub GraphQL + REST API support

  • 🔑 Secure GitHub token storage using Keychain

🧰 Setup

  1. Copy the script into the Scriptable app.

  2. Save it as GitHubStatsWidget.js.

🔐 Token Setup

  1. Generate a GitHub Personal Access Token (PAT)arrow-up-right with:

    • read:user

    • repo

    • read:org

  2. Store it in Scriptable’s Keychain:

🧪 Widget Parameters

Pass parameters to customize behavior:

🧍 Profile Mode:

Shows your overall GitHub stats with the night theme.

📦 Repo Mode:

Format
Description

<repo>,<stat>,<theme>

Shows a specific repo stat

<stat>,<theme>

Profile stats with selected theme

<repo>

Defaults to theme = auto

night

Only theme


📐 Widget Layouts

Size
Layout Details

Small

Focused repo or profile stat + minimal details

Medium

Header + 5 stat lines

Large

Two-column detailed layout (up to 8 metrics)


🎨 Themes

Available values for the third parameter, For Widget stats Themes:

  • auto

  • light

  • dark

  • blue

  • night

  • day

  • gray

  • green

  • gitgreen

  • indigo

For Widget heatmap Themes:

so when using parameter like, "heatmap,{heatmapThemeName}"

  • auto

  • light

  • dark

  • red

  • green

  • forestCalm

  • forestCanopy

  • cyberPurple

  • sunsetGold

  • nordBlueV1

  • nordBlueV2

  • sunsetDusk

  • earthyWarm

  • arcticIce

🛠 Example Use Cases

📎 Notes

  • All API requests use GitHub’s GraphQL v4 and REST API v3.

  • Uses Keychain.get("github_token") for secure token storage.

  • Widget automatically adapts to light/dark mode when using auto theme.

📸 Screenshots

Small Widget

Medium Widgets

Large Widget

🙌 Feedback

Have questions or want help customizing it? DM me on Instagramarrow-up-right or email me at rushiofficial1205@gmail.comenvelope.

Widgets shouldn’t be limited to timers—I’d love to build tools that help you passively learn, reflect, or stay organized. If you have a unique concept in mind, I’d love to collaborate.

📜 License

This project is licensed under the MIT License.

Feel free to fork, build upon, and remix with attribution.

Enjoy using this widget ~ RP

Last updated