discord-api-spec
Version:
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.
34 lines (22 loc) • 1.09 kB
Markdown
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.
```sh
npm install discord-api-spec
```
```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
Generated by [RiskyMH](https://riskymh.dev). Schema by [Discord](https://discord.com)