@octokit/auth-app

GitHub App authentication strategy for JavaScript and Octokit

SDK
npm
v8.3.0
178stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
75/100Good
Development Activity68
Maintenance72
Community80
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture78
Code Quality82
Innovation65
Learning Curve70

@octokit/auth-app implements the full range of GitHub App authentication flows for JavaScript: signing JSON Web Tokens for app-level requests, exchanging them for per-installation access tokens, and handling OAuth user-to-server token flows (web and device). It is designed to be used standalone or plugged directly into Octokit as an auth strategy.

Maintained by the official Octokit organization, it automatically caches and refreshes installation tokens, exposes a hook() for transparent request authentication, and ships full TypeScript types for every authentication object it returns.

What You Get

  • createAppAuth() factory implementing GitHub App JWT authentication
  • Installation access token retrieval and automatic in-memory caching/refresh
  • OAuth App (client ID/secret) authentication support
  • User-to-server OAuth token flows (web flow and device flow)
  • An Octokit-compatible auth.hook() for transparent per-request authentication
  • Full TypeScript types for every authentication result object

Common Use Cases

  • Authenticating a GitHub App’s backend service to call the GitHub REST/GraphQL API
  • Minting short-lived installation tokens for CI bots acting on specific repositories
  • Implementing ‘Sign in with GitHub App’ user OAuth flows
  • Building admin tooling that needs both app-level and per-installation API access
  • Wiring authentication directly into an Octokit client via the auth option

Under The Hood

Architecture - src/index.ts wires together auth.ts (the core createAppAuth factory), get-app-authentication.ts (JWT signing for app-level auth), get-installation-authentication.ts (exchanging a JWT for an installation token via the GitHub API), cache.ts (in-memory token caching keyed by installation), and hook.ts (the Octokit request-hook integration that transparently attaches auth headers) - together forming a strategy object that Octokit’s plugin system consumes uniformly alongside its other auth strategies (auth-oauth-app, auth-oauth-user).

Tech Stack - Pure TypeScript targeting ESM output, built with the shared Octokit build tooling (scripts/build.mjs + tsc), depending on sibling Octokit packages (@octokit/auth-oauth-app, @octokit/auth-oauth-user, @octokit/request) plus universal-github-app-jwt for JWT signing and deprecation/once for small utility concerns - deliberately avoiding a general-purpose JWT library dependency by delegating to a purpose-built one.

Code Quality - Tests run under Vitest with coverage reporting (vitest run --coverage), a pretest lint step enforces Prettier formatting, and a dedicated test:typescript script validates the exported type declarations under strict compiler settings - reflecting the Octokit org’s emphasis on type-correctness for a security-sensitive authentication package.

API Design - A single createAppAuth(options) call returns a callable auth() function whose behavior (JWT vs installation vs OAuth vs user token) is selected by the shape of the arguments passed at call time, which keeps the entry point small; the trade-off is that consumers need the README’s type reference to know which options object produces which authentication result, though TypeScript overloads mitigate this in editors with type-checking.

Used by 12 apps in this directory

TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
TypeScript
99%
Other

Dokploy

Devops · Hosting Control Panel · Security

36,702

Self-hosted PaaS that deploys apps and databases on your own VPS using Docker, Traefik, and multi-build-system orchestration

View details
89
Repo Health
76
Technical
65
Dependency
Built with
TypeScript99%
Updated yesterday
TypeScript
97%
Other

Infisical

Security · Devops

28,838

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript97%
Updated today
TypeScript
96%
Other

Lightdash

Analytics · Data Engineering

6,056

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
66
Dependency
Built with
TypeScript96%
Updated today
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,294

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
88
Repo Health
73
Technical
66
Dependency
Built with
TypeScript99%
Updated today
TypeScript
88%
MIT

Mistle

AI Agents · Developer Tools

89

Self-hostable platform for running autonomous coding agents in isolated, credentialless sandboxes with brokered credentials, reusable snapshots, and event-driven triggers.

View details
71
Repo Health
76
Technical
71
Dependency
Built with
TypeScript88%
Rust11%
Updated 1 months ago
TypeScript
99%
Apache 2.0

Onlook

Design Tools · AI Design Tools

26,512

An open-source, AI-first visual editor that lets designers and developers build, style, and deploy React apps directly in code — no handoff required.

View details
66
Repo Health
80
Technical
68
Dependency
Built with
TypeScript99%
Updated 4 weeks ago
TypeScript
99%
MIT

open-agents

AI Agents · Developer Tools

5,781

Open-source reference app for building and running background AI coding agents on Vercel — from chat prompt to committed code changes without keeping your laptop involved.

View details
49
Repo Health
78
Technical
73
Dependency
Built with
TypeScript99%
Updated 1 weeks ago
TypeScript
76%
MIT

OpenCode

AI Code Assistants

198,979

A fully open-source AI coding agent built for the terminal, with a TUI, desktop app, web client, plugin system, and SDK — one of the most-starred AI coding agents on GitHub.

View details
89
Repo Health
76
Technical
68
Dependency
Built with
TypeScript76%
MDX21%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search