|
| 1 | +--- |
| 2 | +title: Plugins |
| 3 | +description: Reduce third-party boilerplate with our plugin ecosystem. |
| 4 | +--- |
| 5 | + |
| 6 | +<script setup lang="ts"> |
| 7 | +import { embedProject } from '../embed' |
| 8 | +</script> |
| 9 | + |
| 10 | +# Plugins |
| 11 | + |
| 12 | +Hey API plugins reduce third-party boilerplate by generating code specifically tailored to your favorite libraries and frameworks. Instead of writing repetitive integration code, our plugins seamlessly integrate with your existing tools while maintaining type safety and performance. |
| 13 | + |
| 14 | +## Features |
| 15 | + |
| 16 | +- seamless integration with `@hey-api/openapi-ts` ecosystem |
| 17 | +- type-safe generated code for your favorite libraries |
| 18 | +- reduced boilerplate and manual integration work |
| 19 | +- extensive plugin ecosystem covering validation, state management, mocking, and more |
| 20 | +- support for popular frameworks and libraries |
| 21 | +- easy customization and configuration options |
| 22 | + |
| 23 | +## Plugin Categories |
| 24 | + |
| 25 | +Hey API organizes plugins into logical categories to help you find exactly what you need: |
| 26 | + |
| 27 | +### Core Plugins |
| 28 | + |
| 29 | +Essential plugins for basic TypeScript and SDK generation. |
| 30 | + |
| 31 | +- [TypeScript](/openapi-ts/plugins/typescript) - Generate TypeScript types |
| 32 | +- [SDK](/openapi-ts/plugins/sdk) - Generate SDK methods |
| 33 | +- [Transformers](/openapi-ts/plugins/transformers) - Transform request/response data |
| 34 | +- [Schemas](/openapi-ts/plugins/schemas) - Generate JSON schemas |
| 35 | + |
| 36 | +### Clients |
| 37 | + |
| 38 | +REST clients for different runtime environments and libraries. |
| 39 | + |
| 40 | +- [Fetch API](/openapi-ts/clients/fetch) - Modern browser and Node.js fetch |
| 41 | +- [Angular](/openapi-ts/clients/angular) - Angular HTTP client |
| 42 | +- [Axios](/openapi-ts/clients/axios) - Popular HTTP client library |
| 43 | +- [Next.js](/openapi-ts/clients/next-js) - Next.js optimized client |
| 44 | +- [Nuxt](/openapi-ts/clients/nuxt) - Nuxt.js integration |
| 45 | +- [OFetch](/openapi-ts/clients/ofetch) - Minimal fetch wrapper |
| 46 | +- [Effect](/openapi-ts/clients/effect) <span data-soon>Soon</span> - Effect-TS integration |
| 47 | +- [Legacy](/openapi-ts/clients/legacy) - Legacy client support |
| 48 | + |
| 49 | +### Validators |
| 50 | + |
| 51 | +Validate request and response data with popular validation libraries. |
| 52 | + |
| 53 | +- [Valibot](/openapi-ts/plugins/valibot) - Modern schema validation |
| 54 | +- [Zod](/openapi-ts/plugins/zod) - TypeScript-first schema validation |
| 55 | +- [Ajv](/openapi-ts/plugins/ajv) <span data-soon>Soon</span> - JSON Schema validator |
| 56 | +- [Arktype](/openapi-ts/plugins/arktype) <span data-soon>Soon</span> - Runtime type validation |
| 57 | +- [Joi](/openapi-ts/plugins/joi) <span data-soon>Soon</span> - Object schema validation |
| 58 | +- [Superstruct](/openapi-ts/plugins/superstruct) <span data-soon>Soon</span> - Data validation library |
| 59 | +- [TypeBox](/openapi-ts/plugins/typebox) <span data-soon>Soon</span> - JSON Schema Type Builder |
| 60 | +- [Yup](/openapi-ts/plugins/yup) <span data-soon>Soon</span> - Schema validation |
| 61 | + |
| 62 | +### State Management |
| 63 | + |
| 64 | +Integrate with popular state management and data fetching libraries. |
| 65 | + |
| 66 | +- [Pinia Colada](/openapi-ts/plugins/pinia-colada) - Vue.js async state management |
| 67 | +- [TanStack Query](/openapi-ts/plugins/tanstack-query) - Powerful data synchronization |
| 68 | +- [SWR](/openapi-ts/plugins/swr) <span data-soon>Soon</span> - React data fetching |
| 69 | +- [Zustand](/openapi-ts/plugins/zustand) <span data-soon>Soon</span> - Small state management |
| 70 | + |
| 71 | +### Mocking & Testing |
| 72 | + |
| 73 | +Generate mock data and testing utilities for your APIs. |
| 74 | + |
| 75 | +- [Chance](/openapi-ts/plugins/chance) <span data-soon>Soon</span> - Random data generator |
| 76 | +- [Faker](/openapi-ts/plugins/faker) <span data-soon>Soon</span> - Generate fake data |
| 77 | +- [Falso](/openapi-ts/plugins/falso) <span data-soon>Soon</span> - Mock data generator |
| 78 | +- [MSW](/openapi-ts/plugins/msw) <span data-soon>Soon</span> - API mocking for testing |
| 79 | +- [Nock](/openapi-ts/plugins/nock) <span data-soon>Soon</span> - HTTP server mocking |
| 80 | +- [Supertest](/openapi-ts/plugins/supertest) <span data-soon>Soon</span> - HTTP assertion testing |
| 81 | + |
| 82 | +### Web Frameworks |
| 83 | + |
| 84 | +Generate server-side code for popular web frameworks. |
| 85 | + |
| 86 | +- [Angular](/openapi-ts/plugins/angular) - Angular framework integration |
| 87 | +- [Fastify](/openapi-ts/plugins/fastify) - Fast web framework |
| 88 | +- [Adonis](/openapi-ts/plugins/adonis) <span data-soon>Soon</span> - Node.js framework |
| 89 | +- [Elysia](/openapi-ts/plugins/elysia) <span data-soon>Soon</span> - Bun web framework |
| 90 | +- [Express](/openapi-ts/plugins/express) <span data-soon>Soon</span> - Node.js web framework |
| 91 | +- [Hono](/openapi-ts/plugins/hono) <span data-soon>Soon</span> - Ultrafast web framework |
| 92 | +- [Koa](/openapi-ts/plugins/koa) <span data-soon>Soon</span> - Next generation framework |
| 93 | +- [Nest](/openapi-ts/plugins/nest) <span data-soon>Soon</span> - Scalable Node.js framework |
| 94 | + |
| 95 | +### Custom Development |
| 96 | + |
| 97 | +Build your own plugins and clients for specific use cases. |
| 98 | + |
| 99 | +- [Custom Plugin](/openapi-ts/plugins/custom) - Build your own plugin |
| 100 | +- [Custom Client](/openapi-ts/clients/custom) - Create custom HTTP client |
| 101 | + |
| 102 | +## Getting Started |
| 103 | + |
| 104 | +To use plugins with Hey API, install the main package and configure your desired plugins: |
| 105 | + |
| 106 | +```bash |
| 107 | +npm install @hey-api/openapi-ts |
| 108 | +``` |
| 109 | + |
| 110 | +Then configure your plugins in `openapi-ts.config.ts`: |
| 111 | + |
| 112 | +```typescript |
| 113 | +import { defineConfig } from '@hey-api/openapi-ts'; |
| 114 | + |
| 115 | +export default defineConfig({ |
| 116 | + client: '@hey-api/client-fetch', |
| 117 | + input: 'path/to/openapi.json', |
| 118 | + output: 'src/client', |
| 119 | + plugins: ['@hey-api/schemas', '@hey-api/sdk', '@hey-api/typescript'], |
| 120 | +}); |
| 121 | +``` |
| 122 | + |
| 123 | +Don't see the plugin you need? [Build your own](/openapi-ts/plugins/custom) or let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues). |
| 124 | + |
| 125 | +<!--@include: ../partials/examples.md--> |
| 126 | +<!--@include: ../partials/sponsors.md--> |
0 commit comments