A Chrome extension that allows you to sync your LeetCode solutions to a GitHub repository with one click. Features secure OAuth (PKCE) authentication and automatic folder organization.
- One-Click Sync: Sync directly from the LeetCode problem page.
- Secure Auth: Uses GitHub OAuth App with PKCE for secure authorization.
- Auto-Organization: Automatically organizes solutions into folders based on problem topics.
- Custom Repository: Choose any of your GitHub repositories as the destination.
- Theme Switching: Auto-detect system theme with manual toggle between light, dark, and system modes.
- Public & Private Repos: Sync to either public or private repositories with visibility badges.
- Go to your GitHub Settings > Developer settings > OAuth Apps.
- Click New OAuth App.
- Application Name:
LeetCode Sync(or your choice). - Homepage URL:
https://github.com - Authorization callback URL:
https://<YOUR_EXTENSION_ID>.chromiumapp.org/- To find your Extension ID, follow the "Load the Extension" steps below first.
- Create a
.envfile in the root directory:cp .env.example .env
- Open
.envand paste your Client ID and Client Secret from the GitHub OAuth App page:VITE_GITHUB_CLIENT_ID=your_client_id_here VITE_GITHUB_CLIENT_SECRET=your_client_secret_here
- Install dependencies:
npm ci
- Build the project:
npm run build
- Load into Chrome:
- Open Chrome and go to
chrome://extensions/. - Enable Developer mode (toggle in the top right).
- Click Load unpacked.
- Select the
distfolder in this project's root.
- Open Chrome and go to
- Note your Extension ID: After loading, copy the
IDfrom the extension card and update your Authorization callback URL in the GitHub Developer settings if you haven't already.
- Click the extension icon in your browser toolbar.
- (Optional) Change Theme: Click the theme button (π/βοΈ/π) in the top-right corner to toggle between system, light, and dark modes.
- Click Login with GitHub and authorize the application.
- Select the repository where you want to store your solutions:
- π indicates a public repository
- π indicates a private repository
- Go to any problem on LeetCode.
- You will see a green Sync to GitHub button in the language selection section near format code.
- Solve the problem and click Sync to GitHub!
- Token Storage: Your GitHub access token is stored locally using
chrome.storage.local. - Scoped Access: The extension requests the
reposcope to manage both public and private repository files. - Theme Preference: Theme selection is stored locally in browser storage (no tracking or analytics).
The VITE_GITHUB_CLIENT_SECRET is embedded in the extension bundle at build time. For personal/self-hosted use this is acceptable, but avoid publishing the built extension with your real secret. If distributing publicly, set up a backend proxy to handle the token exchange server-side.
Built with React + Vite + TypeScript.