openapi-types.ts
Generated TypeScript definitions built continuously from GitHub's official OpenAPI specification.
Repository Health
Technical Analysis
openapi-types.ts continuously converts GitHub’s official OpenAPI specification into TypeScript definitions and publishes them to npm as @octokit/openapi-types. It provides precise, always-current types for every GitHub REST API endpoint, request, and response, so consumers never hand-maintain GitHub API shapes.
The package is the type foundation of the Octokit ecosystem and is consumed by clients like @octokit/types, but it is also useful on its own for anyone building tools against the GitHub API in TypeScript. Because the types are regenerated from the upstream spec, they stay in lockstep with GitHub’s evolving API surface.
What You Get
- Complete TypeScript types for GitHub REST API endpoints, requests, and responses
- Types generated directly from GitHub’s official OpenAPI description, kept continuously in sync
- Zero runtime dependencies — pure ambient type declarations
- The type foundation used across the Octokit client libraries
- GitHub Enterprise Server variants published as companion packages
Common Use Cases
- Adding precise GitHub API types to Octokit-based clients and plugins
- Type-checking custom tooling that calls the GitHub REST API
- Deriving request/response types for specific GitHub endpoints
- Keeping GitHub API integrations in sync with the latest spec
Under The Hood
Architecture — The repo is a monorepo whose scripts/ pipeline downloads GitHub’s OpenAPI description (download.js), converts it to TypeScript with openapi-typescript (generate-types.js), and stamps versions before publishing (update-package.js). The primary package packages/openapi-types ships a single large types.d.ts (multiple megabytes) exposing the full API surface as ambient declarations; parallel packages target GitHub Enterprise Server releases.
Tech Stack — Pure TypeScript output with zero runtime dependencies in the published package. The generation toolchain is Node.js scripts driving openapi-typescript, run on a schedule to track upstream spec changes.
Code Quality — Because the types are machine-generated from an authoritative source, correctness follows from the upstream OpenAPI spec rather than hand-written code; the value is completeness and freshness. Repo structure cleanly separates generation scripts, per-version packages, and a cache of downloaded specs.
API Design — Consumers simply import the type namespaces; there is no runtime API to learn. The design deliberately keeps the package a passive type dependency, letting higher-level Octokit libraries expose ergonomic wrappers on top.
Used by 3 apps in this directory
Amplication
Developer Tools · AI Code Assistants · Automation
Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.
Convex Backend
Developer Tools · Databases
Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.
Payload CMS
Developer Tools · Blogging · CMS
The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.