# @octokit/webhooks-types

> Generated TypeScript definitions based on community contributed JSON Schemas

Latest version **7.6.1** (published 2024-10-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @octokit/webhooks-types
pnpm add @octokit/webhooks-types
yarn add @octokit/webhooks-types
bun add @octokit/webhooks-types
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 7.6.1 |
| Published | 2024-10-03 |
| First published | 2021-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 217.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 261 |
| Author | Gregor Martynus |
| Maintainers | kfcampbell, nickfloyd, gr2m, octokitbot |

## Links

- npm: https://www.npmjs.com/package/@octokit/webhooks-types
- Repository: https://github.com/octokit/webhooks
- Homepage: https://github.com/octokit/webhooks#readme
- Issues: https://github.com/octokit/webhooks/issues
- npm.io page: https://npm.io/package/@octokit/webhooks-types

## Recent versions

- 7.6.1 (latest) — 2024-10-03
- 3.70.1-beta.2 (beta) — 2021-04-27
- 7.6.0 — 2024-10-03
- 7.5.1 — 2024-04-22
- 7.5.0 — 2024-04-03
- 7.4.0 — 2024-03-11
- 7.3.2 — 2024-02-03
- 7.3.1 — 2023-09-16
- 7.3.0 — 2023-09-11
- 7.2.0 — 2023-08-10
- 7.1.0 — 2023-06-29
- 7.0.3 — 2023-06-07
- 7.0.2 — 2023-05-28
- 7.0.1 — 2023-05-28
- 7.0.0 — 2023-05-27
- … 96 more at https://npm.io/package/@octokit/webhooks-types/versions

## README

# Octokit Webhooks

> machine-readable, always up-to-date GitHub Webhooks specifications

![Update status](https://github.com/octokit/webhooks/workflows/Update/badge.svg)

## Download

Download the latest specification at
[octokit.github.io/webhooks/payload-examples/api.github.com/index.json](https://octokit.github.io/webhooks/payload-examples/api.github.com/index.json)

## Usage

This package ships with types for the webhook events generated from the
respective json schemas, which you can use like so:

```typescript
import { WebhookEvent, IssuesOpenedEvent } from "@octokit/webhooks-types";

const handleWebhookEvent = (event: WebhookEvent) => {
  if ("action" in event && event.action === "completed") {
    console.log(`${event.sender.login} completed something!`);
  }
};

const handleIssuesOpenedEvent = (event: IssuesOpenedEvent) => {
  console.log(
    `${event.sender.login} opened "${event.issue.title}" on ${event.repository.full_name}`,
  );
};
```

**⚠️ Caution ⚠️**: Webhooks Types are expected to be used with the [`strictNullChecks` option](https://www.typescriptlang.org/tsconfig#strictNullChecks) enabled in your `tsconfig`. If you don't have this option enabled, there's the possibility that you get `never` as the inferred type in some use cases. See [#395](https://github.com/octokit/webhooks/issues/395) for details.

## See also

- [octokit/graphql-schema](https://github.com/octokit/graphql-schema) – GitHub’s
  GraphQL Schema with validation
- [octokit/openapi](https://github.com/octokit/openapi) – GitHub REST API route
  specifications
- [octokit/app-permissions](https://github.com/octokit/app-permissions) – GitHub
  App permission specifications

## LICENSE

[MIT](LICENSE.md)

---
_Source: https://npm.io/package/@octokit/webhooks-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
