Files
trpc-nuxt/docs/content/1.get-started/1.installation.md
wobsoriano 0f5c09c7e0 update docs
2022-11-04 07:40:49 -07:00

53 lines
1.0 KiB
Markdown

---
title: Installation
description: tRPC-Nuxt provides first class integration with tRPC.
---
# Installation
## 1. Add to existing Nuxt project
::code-group
```bash [pnpm]
pnpm add @trpc/server@next @trpc/client@next trpc-nuxt@beta zod
```
```bash [npm]
npm install @trpc/server@next @trpc/client@next trpc-nuxt@beta zod
```
```bash [yarn]
yarn add @trpc/server@next @trpc/client@next trpc-nuxt@beta 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](https://github.com/colinhacks/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.
```ts [nuxt.config.ts]
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.