# @octokit/webhooks-schemas

> Community contributed webhook payload schemas in JSON schema format

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-schemas
pnpm add @octokit/webhooks-schemas
yarn add @octokit/webhooks-schemas
bun add @octokit/webhooks-schemas
```

## 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 | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 617.2 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-schemas
- 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-schemas

## 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-schemas/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
[unpkg.com/@octokit/webhooks-schemas/schema.json](https://unpkg.com/@octokit/webhooks-schemas/schema.json)

## Usage as Node module

To get the JSON schema for webhook payloads, require the `@octokit/webhooks-schemas` package.

```js
// Use Node.js require:
const SCHEMA = require("@octokit/webhooks-schemas");

// Or ESM/TypeScript import:
import SCHEMA from "@octokit/webhooks-schemas";
```

### Usage with `ajv` in `strict` mode

When running in `strict` mode, `ajv` will throw an "unknown keyword" error if it
encounters any keywords that have not been defined.

This schema currently uses custom keywords provided by `ajv-formats`, along with
the custom keyword `tsAdditionalProperties`.

Here is an example of how you can set this up:

```ts
import type { WebhookEvent } from "@octokit/webhooks-types";
import * as githubWebhookSchema from "@octokit/webhooks-schemas";
import Ajv from "ajv";
import addFormats from "ajv-formats";

const ajv = new Ajv({ strict: true });

addFormats(ajv);
ajv.addKeyword("tsAdditionalProperties");

const validate = ajv.compile<WebhookEvent>(githubWebhookSchema);
```

## 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-schemas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
