MCPcopy Create free account
hub / github.com/KevzPeter/Duolingo-Stats-Card

github.com/KevzPeter/Duolingo-Stats-Card @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow

🦉 A real-time, customizable Duolingo widget that you can embed on your website or markdown files ✨

20 symbols 40 edges 13 files 3 documented · 15% ● updated 12d ago★ 66

Browse by type

⨍ Functions 16◇ Types & classes 4
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Duolingo Stats Card preview

Duolingo Stats Card

🦉 A real-time, customizable Duolingo widget that you can embed on your website or markdown files ✨






<a href="https://duolingo-stats-card.vercel.app/">✨ View Demo</a>
·
<a href="https://github.com/KevzPeter/duolingo-stats-card/issues">🐛 Report Bug</a>
·
<a href="https://github.com/KevzPeter/duolingo-stats-card/issues">💁🏽 Request Feature</a>

🚀 How to add to your page

Use the demo website to create your customized card! Add the following line to your Github README.md page / website / any markdown file and replace {your-duolingo-username}

<img src="https://duolingo-stats-card.vercel.app/api?username={your-duolingo-username}" alt="Duolingo Stats Card" />

For example, if your Duolingo username is "John_Smith", add the following line (this is in Markdown mode):

![Duolingo Stats Card](https://duolingo-stats-card.vercel.app/api?username=John_Smith)

Want weekly XP, Duolingo scores, hearts, and gems? Deploy your own instance below.

🚀 Deploy using Vercel

To access private Duolingo stats, like your Duolingo proficiency scores, gems, hearts, weekly XP etc, you will need to provide your Duolingo JWT Token. To keep your token secure, you will need to deploy your own Duolingo Stats Card.

Public stats Public + private stats
Public Duolingo Stats Card Duolingo Stats Card with weekly XP, Duolingo scores, hearts, and gems
  1. Click Fork at the top of this repository, then Create fork to make a copy under your GitHub account.
  2. Sign in to Vercel with GitHub. Select Add New → Project, find your fork, and click Import. If it isn't listed, allow Vercel to access it through the GitHub permissions prompt.
  3. Choose a project name, leave the detected Next.js settings as they are, and click Deploy. Wait for the deployment to finish.
  4. Open your new project's Settings → Environment Variables. Add the variables below, selecting Production as the environment for each, and save. Get your token using the steps in the next section.
Name Value
DUOLINGO_JWT Your Duolingo jwt_token. Treat this like a password.
DUOLINGO_USERNAME Your Duolingo username, not your display name. It must belong to the same account as the token.
DUOLINGO_TIMEZONE Optional: your time zone, such as America/Los_Angeles. Leave it unset to use UTC.
  1. Go to Deployments, open the latest production deployment's ⋯ menu, and select Redeploy so it picks up your saved variables.
  2. Once it's ready, open the project's Overview and click its production domain. Your URL will look like https://your-project-name.vercel.app (Vercel may add a suffix if the name is taken). Use this address for your card builder and embeds. Card builder demo
  3. In your deployed card builder, enter the username you configured, choose a theme and animation, and tick the fields you want to show. Drag Duo to position it and use its corner handle to resize it. Click Copy Markdown for a GitHub README or Copy HTML for a website, then paste the result into your page.

The copied code already includes your deployment's address and your selected options. To change your card later, reopen the same builder, customize it, and replace the old embed with the newly copied code. The extra stats checkboxes appear only for your configured username when both required variables are set.

🔑 Get your Duolingo JWT

  1. Sign in to Duolingo in your browser.
  2. Right-click the page and select Inspect to open developer tools.
  3. Open Application (Chrome/Edge) or Storage (Firefox), expand Cookies, and select https://www.duolingo.com.
  4. Find jwt_token and copy its Value into the DUOLINGO_JWT setting in Vercel. Don't copy the cookie name or share the value.

When the token expires, repeat these steps, update the saved value in Vercel, and redeploy from Deployments → ⋯ → Redeploy.

🎨 Themes

Want to spice up the look and feel of your stats card? You can choose your favorite among 15 different themes!

Simply add the theme parameter to the url like so:

<img src="https://duolingo-stats-card.vercel.app/api?username={your-duolingo-username}&amp;theme={your-theme}" alt="Duolingo Stats Card" />

[!NOTE] If you don't specify a theme, it would be rendered like how it's displayed at the top of this doc!

light light dark dark github-dark github-dark
monokai monokai tokyonight tokyonight nightowl nightowl
onedark onedark shades-of-purple shades-of-purple dracula dracula
cobalt2 cobalt2 sky sky beach beach
purple-gang purple-gang mint mint leafy leafy

💻 Run locally

Use Node.js 22+ and pnpm 10.30.3. For owner stats, copy .env.example to .env.local and fill in your variables before starting the server. Keep .env.local out of commits.

pnpm install --frozen-lockfile
pnpm dev

Open localhost:3000. Restart the server after changing environment variables. Run pnpm test with Node.js 22.6 or newer to check the league parser.

🙌🏼 Contributing

If you wanna add your custom theme or suggest enhancements, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 16
Interface 4

Languages

TypeScript100%

Modules by API surface

utils/models.ts4 symbols
utils/sort.ts3 symbols
pages/index.tsx3 symbols
pages/api/index.ts3 symbols
components/SvgWidget.tsx3 symbols
utils/numberFormatter.ts1 symbols
utils/generateSVG.tsx1 symbols
pages/_app.tsx1 symbols
next.config.js1 symbols

For agents

$ claude mcp add --transport http codehub https://codehub.bot/mcp

One hosted endpoint, no key: your agent can search, read and trace KevzPeter/Duolingo-Stats-Card and every other graph here. Cursor, Windsurf and other clients →

⬇ download graph artifact

Ask about this repo answers extend the page