@octokit/webhooks-types

TypeScript type definitions for every GitHub webhook event payload, generated from community-maintained JSON schemas.

Library
npm
v7.6.1
261stars
MIT License

Repository Health

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

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture78
Code Quality62
Innovation58
Learning Curve80

@octokit/webhooks-types provides TypeScript type definitions for GitHub’s webhook event payloads, covering everything from pushes and pull requests to security alerts and workflow runs. The types are generated automatically from JSON Schemas kept in sync with GitHub’s actual webhook payloads, so consumers get accurate, discriminated-union types like PushEvent, IssuesOpenedEvent, and PullRequestReviewEvent without hand-writing interfaces.

The package ships a single schema.d.ts file with zero runtime code and zero dependencies — it’s imported purely for compile-time type checking in webhook handlers, GitHub Apps, and CI bots that need to safely narrow on an event’s action field.

What You Get

  • Full webhook coverage - Types for every GitHub webhook event GitHub publishes, from push and pull_request to dependabot_alert and workflow_run.
  • Discriminated unions - Multi-action events are further split into per-action variants (e.g. IssuesOpenedEvent, IssuesClosedEvent) for precise narrowing.
  • Zero runtime footprint - Ships only a generated .d.ts file with no dependencies, so it adds nothing to bundle size.
  • Auto-regenerated from schemas - Types are compiled by json-schema-to-typescript from the community-maintained JSON Schemas in the same monorepo, so they track GitHub’s payload changes.

Common Use Cases

  • Typing webhook handlers - Narrow an incoming WebhookEvent payload to a specific event/action to safely read fields like issue.title or pull_request.merged.
  • Building GitHub Apps - Get compile-time safety across the dozens of event types a GitHub App or bot might receive.
  • CI/CD bots - Type-check logic that reacts to workflow_run, check_suite, or deployment_status events.
  • Webhook payload validation tooling - Pair the types with @octokit/webhooks or a custom Express/Fastify handler to catch payload-shape regressions at build time.

Under The Hood

Architecture The published package is one leaf of the octokit/webhooks monorepo’s generation pipeline: bin/octokit-schema.mts builds a consolidated JSON Schema from community-contributed payload definitions, and bin/octokit-types.mts compiles that schema into payload-types/schema.d.ts via json-schema-to-typescript, including a hand-assembled EventPayloadMap that maps each webhook event name to its generated interface. @octokit/webhooks-types itself is just that output directory packaged for npm — no source files, no build step at install time, and no code path beyond the type declarations.

Tech Stack The repo is TypeScript/Node (tsx for running .mts scripts), using json-schema-to-typescript and ajv/ajv-formats for schema compilation and validation, got for fetching upstream GitHub documentation, cheerio and turndown for scraping/converting docs into schema fragments, and semantic-release (with per-package pkgRoot npm plugins) to independently version and publish payload-types, payload-schemas, and payload-examples from one repo.

Code Quality The monorepo validates itself rather than the types package having its own test suite: test.mts uses ajv to assert every example in payload-examples matches a basic webhook-definition shape, and bin/validate-schema.mts/validate-payload-examples.mts cross-check the compiled schema against real payloads. CI runs this validation plus Prettier formatting and CodeQL analysis on every push. The types package itself has no runtime logic to unit test — its correctness is entirely a function of the schema-generation pipeline being validated.

What Makes It Unique Most API SDKs hand-write their types; this package instead treats GitHub’s webhook shapes as a machine-generated build artifact, with EventPayloadMap giving consumers a single indexable interface across every event/action combination and the README’s explicit strictNullChecks caveat documenting a real inference gotcha other generated-types packages often leave undocumented.

Used by 9 apps in this directory

TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,893

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
94
Repo Health
82
Technical
64
Dependency
Built with
TypeScript100%
Updated 3 days ago
TypeScript
94%
Apache 2.0

flue

AI Agents · Developer Tools

8,141

Build autonomous AI agents and powerful workflows with a programmable TypeScript harness that gives any model sessions, tools, sandboxes, and durable execution.

View details
67
Repo Health
82
Technical
73
Dependency
Built with
TypeScript94%
Updated 1 weeks ago
TypeScript
61%
EPL-2.0

Huly Platform

Project Management · Team Chat · Collaboration

27,586

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
89
Repo Health
86
Technical
62
Dependency
Built with
TypeScript61%
Svelte34%
Updated 1 weeks ago
TypeScript
97%
Other

Infisical

Security · Devops

29,145

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
65
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
88%
MIT

Mistle

AI Agents · Developer Tools

91

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

View details
70
Repo Health
76
Technical
71
Dependency
Built with
TypeScript88%
Rust11%
Updated 1 months ago
TypeScript
75%
MIT

OpenCode

AI Code Assistants

205,271

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
66
Dependency
Built with
TypeScript75%
MDX21%
Updated today
TypeScript
97%
Other

Outline

Knowledge Management · Collaboration

40,474

A fast, real-time collaborative knowledge base for growing teams built on React, Node.js, and ProseMirror.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
96%
MIT

Payload CMS

Developer Tools · Blogging · CMS

44,600

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
91
Repo Health
88
Technical
65
Dependency
Built with
TypeScript96%
Updated 3 days ago
Python
54%
Other

PostHog

Analytics · Monitoring · Developer Tools

39,612

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python54%
TypeScript36%
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