All articles
Engineering 8 min readApril 23, 2024

GitHub Apps vs. OAuth Apps: The Architecture Decision That Determines Your Integration Quality

Every developer tool that integrates with GitHub faces the same early choice. Most make it without fully understanding the implications. Here's what you need to know.

When we started building CodeMouse, we had to make an early decision: GitHub App or OAuth App? The question sounds like an implementation detail. It's actually an architectural choice that affects the security model, the permission granularity, the rate limit profile, the installation experience, and the long-term reliability of the integration.

We chose GitHub Apps, and two years of operating a production integration have confirmed that it was the right choice for our use case. Here's the full analysis.

The Fundamental Difference

OAuth Apps authenticate as a specific user. When a user authorizes your OAuth App, you receive a token that acts with that user's permissions. Every API call you make is made as that user, counts against that user's rate limits, and depends on that user maintaining their authorization.

GitHub Apps authenticate as themselves — as the application — and act on behalf of installations. When an organization or user installs your GitHub App, they grant specific permissions to the app itself, not to a user token. API calls are made as the app, count against the app's rate limits (which are higher and independent of any user), and persist as long as the installation exists.

Why GitHub Apps Win for Developer Tools

Explicit permission scoping. GitHub Apps declare exactly which permissions they need and request nothing beyond that. A code review tool that needs to read pull requests, write comments, and receive webhooks can declare exactly those permissions and nothing more. OAuth Apps request user scopes that are broader than what most applications actually need. From a security perspective, the principle of least privilege strongly favors GitHub Apps.

Installation-level persistence. OAuth App tokens can be revoked when a user changes their password, when their token expires, or when they manually revoke access. GitHub App installations persist independently of individual user actions — they're installed on the organization or repository, not tied to a specific user's token. For production integrations, this reliability difference is significant.

Rate limits that scale. GitHub Apps receive rate limit allocations per installation, separate from the rate limits of any individual user. An OAuth App that makes many API calls on behalf of users will exhaust those users' rate limits — a real problem for developer tools that process many repositories. GitHub Apps avoid this category of problem entirely.

Webhook delivery at the installation level. GitHub Apps receive webhooks for all repositories in their installation scope without requiring repository-level webhook configuration. For a tool that needs to respond to events across many repositories, this is dramatically simpler than maintaining individual webhook configurations per repository.

When OAuth Apps Are the Right Choice

OAuth Apps are the right choice when your primary need is acting as a specific user — accessing their personal repositories, making commits attributed to them, or doing things on their behalf in a way that should be transparent to other collaborators. Tools where the user identity matters for the action should use OAuth. Tools where the application is acting autonomously on repository content should use GitHub Apps.

The Migration Cost

Migrating from an OAuth App to a GitHub App after you've built on the OAuth model is non-trivial. The permission model is different, the token handling is different, and the installation UX is different. The users who've authorized your OAuth App need to install your GitHub App as a separate step. If you're starting a new GitHub integration, the decision to start with a GitHub App is low-cost. Revisiting it later is not.

Try CodeMouse on your next PR

Free AI code review on every pull request. Bring your own API key — no subscription needed.

Install on GitHub — Free