# discord-api-spec

TypeScript types, flattened JS enums, and Zod schemas generated from [Discord’s OpenAPI spec](https://github.com/discord/discord-api-spec). Built daily for up-to-date data.

## Install

```sh
npm install discord-api-spec
```

## Using the generated files

```ts
// Types
import type { Paths, ApplicationCommandResponse } from "discord-api-spec";

// Emums & paths list
import { pathsList, ApplicationCommandType } from "discord-api-spec";

// Zod Mini schemas (make sure "zod" is also one of your dependencies)
import { UserResponseSchema, ApplicationResponseSchema } from "discord-api-spec/zod";

// Preview equivalents
import type { Paths, ApplicationCommandResponse } from "discord-api-spec/preview";
import { pathsList, ApplicationCommandType } from "discord-api-spec/preview";
import { UserResponseSchema, ApplicationResponseSchema } from "discord-api-spec/preview/zod";
```

You can also see the generated data here: https://app.unpkg.com/discord-api-spec/files/build

## Credits

Generated by [RiskyMH](https://riskymh.dev). Schema by [Discord](https://discord.com)
