···118118119119You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@angular/common/types.ts) interface.
120120121121-<!--@include: ../../partials/examples.md-->
122122-<!--@include: ../../partials/sponsors.md-->
121121+<!--@include: ../../../partials/examples.md-->
122122+<!--@include: ../../../partials/sponsors.md-->
···11+---
22+title: oRPC v1 Plugin
33+description: Generate oRPC v1 contracts from OpenAPI with the oRPC plugin for openapi-ts. Fully compatible with validators, transformers, and all core features.
44+---
55+66+<script setup lang="ts">
77+import AuthorsList from '@components/AuthorsList.vue';
88+import Heading from '@components/Heading.vue';
99+import { stephenZhou } from '@data/people.js';
1010+import VersionLabel from '@components/VersionLabel.vue';
1111+</script>
1212+1313+<Heading>
1414+ <h1>oRPC<span class="sr-only"> v1</span></h1>
1515+ <VersionLabel value="v1" />
1616+</Heading>
1717+1818+::: warning
1919+oRPC plugin is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues).
2020+:::
2121+2222+### About
2323+2424+[oRPC](https://orpc.dev) combines RPC with OpenAPI, allowing you to define and call remote or local procedures through a type-safe API while adhering to the OpenAPI specification.
2525+2626+The oRPC plugin for Hey API generates contracts from your OpenAPI spec, fully compatible with all core features.
2727+2828+### Collaborators
2929+3030+<AuthorsList :people="[stephenZhou]" />
3131+3232+## Features
3333+3434+- oRPC v1 support
3535+- seamless integration with `@hey-api/openapi-ts` ecosystem
3636+- generated contracts
3737+- minimal learning curve thanks to extending the underlying technology
3838+3939+## Installation
4040+4141+In your [configuration](/openapi-ts/get-started), add `orpc` to your plugins and you'll be ready to generate oRPC artifacts. :tada:
4242+4343+```js
4444+export default {
4545+ input: 'hey-api/backend', // sign up at app.heyapi.dev
4646+ output: 'src/client',
4747+ plugins: [
4848+ // ...other plugins
4949+ 'orpc', // [!code ++]
5050+ ],
5151+};
5252+```
5353+5454+## Output
5555+5656+The oRPC plugin will generate the following artifacts, depending on the input specification.
5757+5858+## Contracts
5959+6060+Contracts are generated from all endpoints.
6161+6262+::: code-group
6363+6464+```js [example]
6565+import { oc } from '@orpc/contract';
6666+6767+const addPet = oc.route({
6868+ description: 'Add a new pet to the store.',
6969+ inputStructure: 'detailed',
7070+ method: 'POST',
7171+ operationId: 'addPet',
7272+ path: '/pet',
7373+ summary: 'Add a new pet to the store.',
7474+ tags: ['pet'],
7575+});
7676+```
7777+7878+```js [config]
7979+export default {
8080+ input: 'hey-api/backend', // sign up at app.heyapi.dev
8181+ output: 'src/client',
8282+ plugins: [
8383+ // ...other plugins
8484+ 'orpc',
8585+ ],
8686+};
8787+```
8888+8989+:::
9090+9191+### Validators
9292+9393+To enable schema validation, set `validator` to `zod` or one of the available [validator plugins](/openapi-ts/validators). This will implicitly add the selected plugin with default values.
9494+9595+For a more granular approach, manually add a validator plugin and set `validator` to the plugin name or `true` to automatically select a compatible plugin. Until you customize the validator plugin, both approaches will produce the same default output.
9696+9797+::: code-group
9898+9999+```js [example]
100100+import { oc } from '@orpc/contract';
101101+102102+import { vAddPetData, vAddPetResponse } from './valibot.gen';
103103+104104+const addPet = oc
105105+ .route({
106106+ description: 'Add a new pet to the store.',
107107+ inputStructure: 'detailed',
108108+ method: 'POST',
109109+ operationId: 'addPet',
110110+ path: '/pet',
111111+ summary: 'Add a new pet to the store.',
112112+ tags: ['pet'],
113113+ })
114114+ .input(vAddPetData) // [!code ++]
115115+ .output(vAddPetResponse); // [!code ++]
116116+```
117117+118118+```js [config]
119119+export default {
120120+ input: 'hey-api/backend', // sign up at app.heyapi.dev
121121+ output: 'src/client',
122122+ plugins: [
123123+ // ...other plugins
124124+ {
125125+ name: 'orpc',
126126+ validator: true, // or 'valibot' // [!code ++]
127127+ },
128128+ {
129129+ name: 'valibot', // customize (optional) // [!code ++]
130130+ // other options
131131+ },
132132+ ],
133133+};
134134+```
135135+136136+:::
137137+138138+You can choose to validate only inputs or outputs.
139139+140140+::: code-group
141141+142142+```js [inputs]
143143+export default {
144144+ input: 'hey-api/backend', // sign up at app.heyapi.dev
145145+ output: 'src/client',
146146+ plugins: [
147147+ // ...other plugins
148148+ {
149149+ name: 'orpc',
150150+ validator: {
151151+ input: 'zod', // [!code ++]
152152+ },
153153+ },
154154+ ],
155155+};
156156+```
157157+158158+```js [outputs]
159159+export default {
160160+ input: 'hey-api/backend', // sign up at app.heyapi.dev
161161+ output: 'src/client',
162162+ plugins: [
163163+ // ...other plugins
164164+ {
165165+ name: 'orpc',
166166+ validator: {
167167+ output: 'zod', // [!code ++]
168168+ },
169169+ },
170170+ ],
171171+};
172172+```
173173+174174+:::
175175+176176+Learn more about available validators on the [Validators](/openapi-ts/validators) page.
177177+178178+## API
179179+180180+You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/orpc/types.ts) interface.
181181+182182+<!--@include: ../../partials/examples.md-->
183183+<!--@include: ../../partials/sponsors.md-->
+1-1
docs/openapi-ts/plugins/transformers.md
···153153154154You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/transformers/types.ts) interface.
155155156156-<!--@include: ../partials/sponsors.md-->
156156+<!--@include: ../../partials/sponsors.md-->
···306306307307### Client
308308309309-Clients are responsible for sending the actual HTTP requests. Using clients is not required, but you must add a client to `plugins` if you're generating SDKs (we default to Fetch).
309309+Clients are responsible for sending the actual HTTP requests. We default to Fetch client if you're generating SDKs, but you can choose a different option from the available clients.
310310311311-### Native Clients
311311+### Available Clients
312312313313- [`@hey-api/client-fetch`](https://heyapi.dev/openapi-ts/clients/fetch)
314314- [`@hey-api/client-angular`](https://heyapi.dev/openapi-ts/clients/angular)
···318318- [`@hey-api/client-nuxt`](https://heyapi.dev/openapi-ts/clients/nuxt)
319319- [`@hey-api/client-ofetch`](https://heyapi.dev/openapi-ts/clients/ofetch)
320320321321-### Planned Clients
321321+### Proposed Clients (Vote to Prioritize)
322322323323-The following clients are planned but not in development yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/labels/RSVP%20%F0%9F%91%8D%F0%9F%91%8E).
323323+The following clients are roadmap proposals and are not started yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/issues?q=state%3Aopen%20label%3A%22vote%20%F0%9F%93%A9%22).
324324325325- [`@hey-api/client-effect`](https://heyapi.dev/openapi-ts/clients/effect)
326326327327Don't see your client? [Build your own](https://heyapi.dev/openapi-ts/clients/custom) or let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).
328328329329-### Native Plugins
329329+### Available Plugins
330330331331These plugins help reduce boilerplate associated with third-party dependencies. Hey API natively supports the most popular packages. Please open an issue on [GitHub](https://github.com/hey-api/openapi-ts/issues) if you'd like us to support your favorite package.
332332···343343- [`@tanstack/svelte-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
344344- [`@tanstack/vue-query`](https://heyapi.dev/openapi-ts/plugins/tanstack-query)
345345- [`fastify`](https://heyapi.dev/openapi-ts/plugins/fastify)
346346+- [`orpc`](https://heyapi.dev/openapi-ts/plugins/orpc)
346347- [`nestjs`](https://heyapi.dev/openapi-ts/plugins/nest)
347348- [`valibot`](https://heyapi.dev/openapi-ts/plugins/valibot)
348349- [`zod`](https://heyapi.dev/openapi-ts/plugins/zod)
349350350350-### Planned Plugins
351351+### Proposed Plugins (Vote to Prioritize)
351352352352-The following plugins are planned but not in development yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/labels/RSVP%20%F0%9F%91%8D%F0%9F%91%8E).
353353+The following plugins are roadmap proposals and are not started yet. You can help us prioritize them by voting on [GitHub](https://github.com/hey-api/openapi-ts/issues?q=state%3Aopen%20label%3A%22vote%20%F0%9F%93%A9%22).
353354354355- [Adonis](https://heyapi.dev/openapi-ts/plugins/adonis)
355356- [Ajv](https://heyapi.dev/openapi-ts/plugins/ajv)