Overview
WhatDoc uses GitHub OAuth to securely access your repositories. You can choose to connect with access to public repositories only, or include private repositories for comprehensive documentation generation.Connect Your GitHub Account
Navigate to Import Page
From your dashboard, click Import Repository or navigate to
/import. You’ll see a GitHub connection prompt if you haven’t connected yet.Choose Repository Access
Before connecting, toggle the Include private repositories option:
- Public only: Grants access to your public repositories using the
public_reposcope - Public + Private: Grants full repository access using the
reposcope
Authorize with GitHub
Click Connect GitHub. You’ll be redirected to GitHub’s OAuth authorization page.GitHub will ask you to authorize WhatDoc with the requested permissions. Review and click Authorize to continue.
OAuth Flow Details
The GitHub OAuth flow works as follows:- Request Authorization URL: WhatDoc calls
GET /api/auth/github?includePrivate=trueto get the OAuth URL - GitHub Redirect: You’re sent to
https://github.com/login/oauth/authorizewith:client_id: WhatDoc’s GitHub App IDscope: Eitheruser:email,public_repooruser:email,repostate: Your user ID for security verification
- Callback: GitHub redirects to
/api/auth/github/callbackwith an authorization code - Token Exchange: WhatDoc exchanges the code for an access token
- Profile Fetch: Your GitHub profile is fetched to link your account
- Security Check: The system ensures one GitHub account = one WhatDoc account
- Storage: Your GitHub username, ID, and access token are securely stored
Browse Your Repositories
Once connected, the import page displays all your repositories:- Search: Filter repositories by name using the search bar
- Filter: Toggle between all repos, public only, or private only
- Metadata: Each repo shows:
- Primary programming language with color indicator
- Description
- Last update time (e.g., “2h ago”, “Jan 30”)
- Privacy status (lock icon for private repos)
- Star count
WhatDoc fetches up to 100 repositories per page and automatically paginates through all your repos, sorted by most recently updated.
Import a Repository
To generate documentation for a repository:- Browse your repositories on the
/importpage - Locate the repository you want to document
- Click the Import button next to the repository
- You’ll be redirected to
/configureto set up your documentation project
username/repo-name) is passed as a URL parameter for the next configuration step.
Unlinking GitHub
To disconnect your GitHub account:- Go to your Profile settings
- Navigate to the Connected Accounts section
- Click Unlink GitHub
- Confirm the action
Security Considerations
- Your GitHub access token is stored encrypted in the database
- Tokens are used exclusively for repository access during documentation generation
- WhatDoc never accesses your token for purposes beyond documentation generation
- You can revoke WhatDoc’s access anytime via GitHub Settings > Applications
Troubleshooting
| Error | Cause | Solution |
|---|---|---|
no_code | OAuth flow didn’t return authorization code | Retry the connection process |
already_linked | Your GitHub account is linked to another WhatDoc user | Use a different GitHub account or contact support |
server_error | Backend processing failed | Retry after a few moments |
GitHub not connected | Token expired or removed | Reconnect your GitHub account |
What’s Next?
After connecting GitHub and importing a repository, proceed to:Generating Docs
Configure and generate your documentation
Customizing Docs
Add your logo, branding, and navigation
