logo
Time in Code

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

  1. Open VS Code
  2. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  3. Type: "Time in Code: Log in with GitHub"
  4. Your browser will open and redirect to GitHub
  5. Authorize the application
  6. 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

  1. Extension opens your browser to GitHub OAuth
  2. You authorize the app to read your GitHub profile
  3. GitHub redirects back with a secure code
  4. Our backend exchanges the code for your GitHub ID and generates a token
  5. Extension receives both your GitHub ID and token
  6. 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 Header
Authorization: Bearer YOUR_TOKEN

Your 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:

  1. Press Ctrl+Shift+P
  2. 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:

  1. Press Ctrl+Shift+P
  2. 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.