Skip to content

RiskyMH/discord-api-spec-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-api-spec

TypeScript types, flattened JS enums, and Zod schemas generated from Discord’s OpenAPI spec. Built daily for up-to-date data.

Install

npm install discord-api-spec

Using the generated files

// 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. Schema by Discord

About

TypeScript generated edition for Discord's OpenAPI schema

Topics

Resources

License

Stars

Watchers

Forks

Contributors