@octokit/core

Extendable client for GitHub's REST and GraphQL APIs

SDK
npm
v7.0.8
1,286 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
84 /100 Excellent
Development Activity 72
Maintenance 76
Community 88
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
80 /100 Excellent
Architecture 85
Code Quality 82
Innovation 80
Learning Curve 74

@octokit/core is the minimal, extendable client at the heart of the Octokit ecosystem for calling GitHub’s REST and GraphQL APIs. It bundles authentication, request signing, and hook-based middleware into a single Octokit class that can be extended with plugins and defaults, letting teams build a custom Octokit tailored to exactly the endpoints and behavior they need rather than pulling in the full, heavier octokit package.

Beyond just making requests, it standardizes how the wider Octokit family (REST plugins, GraphQL, authentication strategies, pagination) compose together, which is why it underpins most GitHub Apps, Actions, and automation tooling written in JavaScript/TypeScript.

What You Get

  • A minimal Octokit class supporting both REST (octokit.request()) and GraphQL (octokit.graphql()) calls out of the box
  • A plugin system (Octokit.plugin()) for composing additional functionality like the full REST endpoint methods, pagination, or throttling
  • Built-in authentication support via @octokit/auth-token and pluggable custom auth strategies (Apps, OAuth, installation tokens)
  • A hooks API (before, after, error, request) for intercepting and modifying every request/response
  • Runs in Node.js and browsers, with first-class TypeScript types generated from the OpenAPI-derived Octokit spec

Common Use Cases

  • Building a custom, minimal GitHub API client with only the plugins and auth strategy a project actually needs
  • Powering GitHub Apps and Actions that need authenticated REST/GraphQL access to repositories, issues, and pull requests
  • Writing CI/automation scripts that query or mutate GitHub data (labels, releases, workflow runs) via a consistent client
  • Composing custom Octokit distributions as a base for internal SDKs or tools by layering project-specific plugins on top of core

Under The Hood

Architecture - src/index.ts defines the Octokit base class: its constructor wires up hooks (via before-after-hook), an auth strategy, and default request options, then exposes request (delegating to @octokit/request) and graphql (delegating to @octokit/graphql) as bound methods; the static Octokit.plugin() method returns a new subclass with additional instance properties/methods mixed in, which is how the rest of the Octokit ecosystem (REST endpoint methods, pagination, retry, throttling) is layered on without bloating the core.

Tech Stack - Pure TypeScript, published as an ESM module ("type": "module"), depending on sibling Octokit packages (@octokit/auth-token, @octokit/graphql, @octokit/request, @octokit/request-error) rather than reimplementing HTTP/auth logic; the build pipeline uses a custom scripts/build.mjs plus tsc, and tests run under Vitest with coverage, alongside a dedicated test:typescript step that type-checks example usage under strict compiler options.

Code Quality - The core module itself is deliberately small (three files: index.ts, types.ts, version.ts), pushing complexity out to well-tested sibling packages and plugins, which keeps the surface area easy to reason about; the test:typescript validation step is a notable quality practice, catching type-level regressions in consumer-facing generics that unit tests alone would miss.

API Design - The plugin-composition pattern (Octokit.plugin(pluginA, pluginB)) is the standout ergonomic choice: it lets consumers opt into exactly the functionality they need (e.g. skip REST endpoint sugar if they only need GraphQL) while keeping a single, consistent Octokit mental model across the whole ecosystem, at the cost of needing to understand the plugin/hook system to extend behavior.

Used by 15 apps in this directory

TypeScript
89%
GPL 3.0

NoteGen

AI Assistants · Knowledge Management · Note Taking

12,914

Capture anything first, then let AI transform your scattered records into polished, structured Markdown notes with RAG-powered knowledge retrieval.

View details
87
Repo Health
74
Technical
67
Dependency
Built with
TypeScript 89%
Updated 6 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,195

Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
90%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,125

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 90%
Updated 6 days ago
TypeScript
97%
Other

Rocket.Chat

Team Chat

46,304

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
63
Dependency
Built with
TypeScript 97%
Updated 5 days ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 5 days ago
Rust
79%
Apache 2.0

TensorZero

Ab Testing Experimentation · AI Development · Monitoring

11,708

TensorZero unifies the LLM gateway, observability, evaluation, optimization, and experimentation stack behind a single OpenAI-compatible API, built in Rust for sub-millisecond p99 latency.

View details
53
Repo Health
87
Technical
68
Dependency
Built with
Rust 79%
TypeScript 15%
Updated 4 months ago

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