mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 20:19:33 +01:00
1.0 KiB
1.0 KiB
title, description
| title | description |
|---|---|
| Installation | tRPC-Nuxt provides first class integration with tRPC. |
Installation
1. Add to existing Nuxt project
::code-group
pnpm add @trpc/server@next @trpc/client@next trpc-nuxt zod
npm install @trpc/server@next @trpc/client@next trpc-nuxt zod
yarn add @trpc/server@next @trpc/client@next trpc-nuxt zod
::
Why @trpc/server?
For implementing tRPC endpoints and routers.
Why @trpc/client?
For making typesafe API calls from your client.
Why zod?
Most examples use Zod for input validation and tRPC.io highly recommends it, though it isn't required.
2. Install module
This will transpile trpc-nuxt and exclude trpc-nuxt/client from optimized dependencies by Vite.
export default defineNuxtConfig({
modules: ['trpc-nuxt/module']
})
::
Next Steps
Now that you've installed the required dependencies, you are ready to start building your application.