Authentication
How to log in with GitHub and manage your API access.
How It Works
Time in Code uses GitHub OAuth for authentication. When you log in, the extension receives a secure token that's tied to your GitHub account.
Log in with GitHub
- Open VS Code
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Type: "Time in Code: Log in with GitHub"
- Your browser will open and redirect to GitHub
- Authorize the application
- You'll be redirected back to VS Code automatically
✅ First-Time Setup
The extension will prompt you to log in with GitHub on first run. Just click "Log in with GitHub" and follow the flow.
What Happens During Login
- Extension opens your browser to GitHub OAuth
- You authorize the app to read your GitHub profile
- GitHub redirects back with a secure code
- Our backend exchanges the code for your GitHub ID and generates a token
- Extension receives both your GitHub ID and token
- Tracking starts automatically
Using Your Token
The token is automatically stored in VS Code's secure storage. If you need to use the API directly, include it in the Authorization header:
Authorization: Bearer YOUR_TOKENYour GitHub ID
Your GitHub ID (not your username) is used as your unique identifier. This means:
- Same GitHub account = same data across all devices
- Your dashboard URL:
/dashboard/YOUR_GITHUB_ID - Your stats are tied to your GitHub account permanently
View Your Account Info
To see your GitHub ID and token:
- Press
Ctrl+Shift+P - Type: "Time in Code: Show Account Info"
Token Security
- Tokens are stored in VS Code's encrypted Secrets API
- Never share your token publicly
- Tokens are unique per GitHub account
- Logging in again will give you the same token (not generate new)
Logout
To log out and stop tracking:
- Press
Ctrl+Shift+P - Type: "Time in Code: Logout"
This will remove your token and GitHub ID from local storage. Your data remains in the database.
Privacy
We only request read:user scope from GitHub, which gives us:
- Your GitHub ID (numeric)
- Your GitHub username
- Your avatar URL
We cannot access your repositories, code, or any other private information.
Need Help?
If login fails, check Troubleshooting or open an issue on GitHub.
