{"_id":"@mguay/nestjs-trpc","_rev":"4-9a3c174f3749b8a2e45d4ff4703b1a59","name":"@mguay/nestjs-trpc","dist-tags":{"latest":"1.6.4"},"versions":{"1.6.1":{"name":"@mguay/nestjs-trpc","version":"1.6.1","keywords":["nestjs","trpc","adapter","nest","express","fastify","api","typescript","types"],"author":{"url":"https://kevin-edry.com","name":"Kevin Edry","email":"kevin.edry@gmail.com"},"license":"MIT","_id":"@mguay/nestjs-trpc@1.6.1","maintainers":[{"name":"mguay","email":"guay.me@gmail.com"}],"homepage":"https://nestjs-trpc.io","bugs":{"url":"https://github.com/KevinEdry/nestjs-trpc/issues"},"dist":{"shasum":"e6d4145fcc1812e9bd5ad2c368610beb94c44fe8","tarball":"https://registry.npmjs.org/@mguay/nestjs-trpc/-/nestjs-trpc-1.6.1.tgz","fileCount":194,"integrity":"sha512-SUNLYOl9/WTMGq0RijpGY0Fn1U4O3grBSug72ItS7srUs4/2QjpZA+4yaevLt51RxpvWoPBLoliNhXb8rxduoQ==","signatures":[{"sig":"MEQCIAuT349RvRO8OaitlLOAJ/MYvClYJ0rh08eUpGJPIrOYAiAlJ14YqEmgLKAKxUTyFA6r2YWPOMgGY1A28eS7WcEalQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":190158},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"8e921ebbfe6207a7c43f7a15e1c216c6639d39d8","scripts":{"test":"TS_JEST_DISABLE_VER_CHECKER=true jest --no-watchman --coverage","build":"rm -rf dist && tsc --project tsconfig.build.json","clean":"tsc -b --clean","debug:dev":"ts-node --inspect-brk lib/index.ts","start:dev":"tsc --project tsconfig.json --watch --preserveWatchOutput"},"_npmUser":{"name":"mguay","email":"guay.me@gmail.com"},"repository":{"url":"git+https://github.com/KevinEdry/nestjs-trpc.git","type":"git","directory":"packages/nestjs-trpc"},"_npmVersion":"10.1.0","description":"<a href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\">   <picture>     <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" />     <img alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" />   </picture> </a>","directories":{},"_nodeVersion":"20.9.0","dependencies":{"tslib":"^2.5.0","lodash":"^4.17.21","ts-morph":"22.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.14.4","jest":"^29.7.0","rxjs":"7.8.1","fastify":"^5.0.0","ts-jest":"^29.2.5","ts-node":"10.9.2","type-fest":"^4.21.0","typescript":"5.5.3","@types/jest":"^29.5.12","@types/node":"^22.5.0","@nestjs/core":"10.4.1","@trpc/server":"^10.18.0","@types/lodash":"^4.17.5","@nestjs/common":"10.4.1","@types/express":"^4.17.17","tsconfig-paths":"^4.2.0","@nestjs/testing":"10.4.1","reflect-metadata":"0.1.13"},"peerDependencies":{"zod":"^3.14.0","rxjs":"7.8.1","@nestjs/core":"^9.3.8 || ^10.0.0","@trpc/server":"^10.0.0","@nestjs/common":"^9.3.8 || ^10.0.0","reflect-metadata":"^0.1.13 || ^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-trpc_1.6.1_1761485543771_0.558990089672097","host":"s3://npm-registry-packages-npm-production"}},"1.6.2":{"name":"@mguay/nestjs-trpc","version":"1.6.2","keywords":["nestjs","trpc","adapter","nest","express","fastify","api","typescript","types"],"author":{"url":"https://kevin-edry.com","name":"Kevin Edry","email":"kevin.edry@gmail.com"},"license":"MIT","_id":"@mguay/nestjs-trpc@1.6.2","maintainers":[{"name":"mguay","email":"guay.me@gmail.com"}],"homepage":"https://nestjs-trpc.io","bugs":{"url":"https://github.com/KevinEdry/nestjs-trpc/issues"},"dist":{"shasum":"7b0004ff61a96923f22c54c9f1ef677caeae7067","tarball":"https://registry.npmjs.org/@mguay/nestjs-trpc/-/nestjs-trpc-1.6.2.tgz","fileCount":194,"integrity":"sha512-MpeYs5RrmL5thdwe83d20qi3j7Kk/1stOIIhLtaj9eQ4mroWU9tyiNRHjARvXSV8I+BXIEo2un1QpxRjLdXYrg==","signatures":[{"sig":"MEYCIQCt+HVhaZWilvShme6ru4tB00zD8h6LwLwnObeuVBVr2gIhANoUIUcSzAG31PpxjJExzsbZ+UxNHLtICSp/1z4hZvu/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":191103},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"8e921ebbfe6207a7c43f7a15e1c216c6639d39d8","scripts":{"test":"TS_JEST_DISABLE_VER_CHECKER=true jest --no-watchman --coverage","build":"rm -rf dist && tsc --project tsconfig.build.json","clean":"tsc -b --clean","debug:dev":"ts-node --inspect-brk lib/index.ts","start:dev":"tsc --project tsconfig.json --watch --preserveWatchOutput"},"_npmUser":{"name":"mguay","email":"guay.me@gmail.com"},"repository":{"url":"git+https://github.com/KevinEdry/nestjs-trpc.git","type":"git","directory":"packages/nestjs-trpc"},"_npmVersion":"10.1.0","description":"<a href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\">   <picture>     <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" />     <img alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" />   </picture> </a>","directories":{},"_nodeVersion":"20.9.0","dependencies":{"tslib":"^2.5.0","lodash":"^4.17.21","ts-morph":"22.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.14.4","jest":"^29.7.0","rxjs":"7.8.1","fastify":"^5.0.0","ts-jest":"^29.2.5","ts-node":"10.9.2","type-fest":"^4.21.0","typescript":"5.5.3","@types/jest":"^29.5.12","@types/node":"^22.5.0","@nestjs/core":"10.4.1","@trpc/server":"^10.18.0","@types/lodash":"^4.17.5","@nestjs/common":"10.4.1","@types/express":"^4.17.17","tsconfig-paths":"^4.2.0","@nestjs/testing":"10.4.1","reflect-metadata":"0.1.13"},"peerDependencies":{"zod":"^3.14.0","rxjs":"7.8.1","@nestjs/core":"^9.3.8 || ^10.0.0","@trpc/server":"^10.0.0","@nestjs/common":"^9.3.8 || ^10.0.0","reflect-metadata":"^0.1.13 || ^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-trpc_1.6.2_1761485799347_0.07695234093856995","host":"s3://npm-registry-packages-npm-production"}},"1.6.3":{"name":"@mguay/nestjs-trpc","version":"1.6.3","keywords":["nestjs","trpc","adapter","nest","express","fastify","api","typescript","types"],"author":{"url":"https://kevin-edry.com","name":"Kevin Edry","email":"kevin.edry@gmail.com"},"license":"MIT","_id":"@mguay/nestjs-trpc@1.6.3","maintainers":[{"name":"mguay","email":"guay.me@gmail.com"}],"homepage":"https://nestjs-trpc.io","bugs":{"url":"https://github.com/KevinEdry/nestjs-trpc/issues"},"dist":{"shasum":"fc9edfd5ef6103f905f5c94993c1d10c41238b7d","tarball":"https://registry.npmjs.org/@mguay/nestjs-trpc/-/nestjs-trpc-1.6.3.tgz","fileCount":194,"integrity":"sha512-7z5EVlKtKGudsOP+bbwBKqyvDMZHG0Ohg6LCjlT0HmzMnvuWzOhGMxYQjOuWmOoKB+qKRnSwyjz4xI/YKVH+cg==","signatures":[{"sig":"MEYCIQDSdgJlPVx1XfCXVgkMLcQ3PadtqlVqWZiukhUVcrnUdQIhAK+uoXM81rbJ44udMDUa+sbgxIKuwOUcVvhtV+fuZfJY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":191373},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"e48f6f778218e617b63bfe104d542ab152039663","scripts":{"test":"TS_JEST_DISABLE_VER_CHECKER=true jest --no-watchman --coverage","build":"rm -rf dist && tsc --project tsconfig.build.json","clean":"tsc -b --clean","debug:dev":"ts-node --inspect-brk lib/index.ts","start:dev":"tsc --project tsconfig.json --watch --preserveWatchOutput"},"_npmUser":{"name":"mguay","email":"guay.me@gmail.com"},"repository":{"url":"git+https://github.com/KevinEdry/nestjs-trpc.git","type":"git","directory":"packages/nestjs-trpc"},"_npmVersion":"10.1.0","description":"<a href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\">   <picture>     <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" />     <img alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" />   </picture> </a>","directories":{},"_nodeVersion":"20.9.0","dependencies":{"tslib":"^2.5.0","lodash":"^4.17.21","ts-morph":"22.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.14.4","jest":"^29.7.0","rxjs":"7.8.1","fastify":"^5.0.0","ts-jest":"^29.2.5","ts-node":"10.9.2","type-fest":"^4.21.0","typescript":"5.5.3","@types/jest":"^29.5.12","@types/node":"^22.5.0","@nestjs/core":"10.4.1","@trpc/server":"^10.18.0","@types/lodash":"^4.17.5","@nestjs/common":"10.4.1","@types/express":"^4.17.17","tsconfig-paths":"^4.2.0","@nestjs/testing":"10.4.1","reflect-metadata":"0.1.13"},"peerDependencies":{"zod":"^3.14.0","rxjs":"7.8.1","@nestjs/core":"^9.3.8 || ^10.0.0","@trpc/server":"^10.0.0","@nestjs/common":"^9.3.8 || ^10.0.0","reflect-metadata":"^0.1.13 || ^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-trpc_1.6.3_1761488281094_0.49472889337481973","host":"s3://npm-registry-packages-npm-production"}},"1.6.4":{"name":"@mguay/nestjs-trpc","version":"1.6.4","homepage":"https://nestjs-trpc.io","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"rm -rf dist && tsc --project tsconfig.build.json","start:dev":"tsc --project tsconfig.json --watch --preserveWatchOutput","debug:dev":"ts-node --inspect-brk lib/index.ts","clean":"tsc -b --clean","test":"TS_JEST_DISABLE_VER_CHECKER=true jest --no-watchman --coverage"},"keywords":["nestjs","trpc","adapter","nest","express","fastify","api","typescript","types"],"author":{"name":"Kevin Edry","email":"kevin.edry@gmail.com","url":"https://kevin-edry.com"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"peerDependencies":{"@nestjs/common":"^9.3.8 || ^10.0.0","@nestjs/core":"^9.3.8 || ^10.0.0","@trpc/server":"^10.0.0","reflect-metadata":"^0.1.13 || ^0.2.0","rxjs":"7.8.1","zod":"^3.14.0"},"devDependencies":{"@nestjs/common":"10.4.1","@nestjs/core":"10.4.1","@nestjs/testing":"10.4.1","@trpc/server":"^10.18.0","@types/express":"^4.17.17","@types/jest":"^29.5.12","@types/lodash":"^4.17.5","@types/node":"^22.5.0","fastify":"^5.0.0","jest":"^29.7.0","reflect-metadata":"0.1.13","rxjs":"7.8.1","ts-jest":"^29.2.5","ts-node":"10.9.2","tsconfig-paths":"^4.2.0","type-fest":"^4.21.0","typescript":"5.5.3","zod":"^3.14.4"},"dependencies":{"lodash":"^4.17.21","ts-morph":"22.0.0","tslib":"^2.5.0"},"repository":{"type":"git","url":"git+https://github.com/KevinEdry/nestjs-trpc.git","directory":"packages/nestjs-trpc"},"_id":"@mguay/nestjs-trpc@1.6.4","gitHead":"e48f6f778218e617b63bfe104d542ab152039663","description":"<a href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\">   <picture>     <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" />     <img alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" />   </picture> </a>","bugs":{"url":"https://github.com/KevinEdry/nestjs-trpc/issues"},"_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-hcAQfere8mTOGQwDF+8Wy2zG1Tg0Dfjm5THViZFnY/6fVOZWuMp+0lIfhvzlHtbx2hnfAbNuX1+vuPElH1v7AQ==","shasum":"2af9d2a4e875032a5fb0e29ce09a52a69c80c528","tarball":"https://registry.npmjs.org/@mguay/nestjs-trpc/-/nestjs-trpc-1.6.4.tgz","fileCount":194,"unpackedSize":192429,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE8pVJPi2enyDzzpzCmkG9Gf/aJ7bf6PBn+UN7xhfdXnAiEA2jk7XEMdITuwE0p4bcQ0f77napXTdxXmOleSTN1+UQM="}]},"_npmUser":{"name":"mguay","email":"guay.me@gmail.com"},"directories":{},"maintainers":[{"name":"mguay","email":"guay.me@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-trpc_1.6.4_1761488838257_0.9042098041935043"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-26T13:32:23.702Z","modified":"2025-10-26T14:27:18.663Z","1.6.1":"2025-10-26T13:32:23.992Z","1.6.2":"2025-10-26T13:36:39.550Z","1.6.3":"2025-10-26T14:18:01.312Z","1.6.4":"2025-10-26T14:27:18.462Z"},"bugs":{"url":"https://github.com/KevinEdry/nestjs-trpc/issues"},"author":{"name":"Kevin Edry","email":"kevin.edry@gmail.com","url":"https://kevin-edry.com"},"license":"MIT","homepage":"https://nestjs-trpc.io","keywords":["nestjs","trpc","adapter","nest","express","fastify","api","typescript","types"],"repository":{"type":"git","url":"git+https://github.com/KevinEdry/nestjs-trpc.git","directory":"packages/nestjs-trpc"},"description":"<a href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\">   <picture>     <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" />     <img alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" />   </picture> </a>","maintainers":[{"name":"mguay","email":"guay.me@gmail.com"}],"readme":"<a href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" />\n    <img alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" />\n  </picture>\n</a>\n\n<div align=\"center\">\n  <h1>Nestjs tRPC Adapter</h1>\n  <h3>An opinionated approach to building<br />End-to-end typesafe APIs with tRPC within NestJS.</h3>\n  <a href=\"https://npmcharts.com/compare/nestjs-trpc?interval=30\">\n    <img alt=\"weekly downloads\" src=\"https://img.shields.io/npm/dm/nestjs-trpc.svg\">\n  </a>\n  <a href=\"https://github.com/KevinEdry/nestjs-trpc/blob/main/LICENSE\">\n    <img alt=\"MIT License\" src=\"https://img.shields.io/github/license/KevinEdry/nestjs-trpc\" />\n  </a>\n  <a href=\"https://discord.gg/trpc-867764511159091230\">\n    <img alt=\"Discord\" src=\"https://img.shields.io/discord/867764511159091230?color=7389D8&label&logo=discord&logoColor=ffffff\" />\n  </a>\n  <br />\n  <figure>\n    <img src=\"https://assets.trpc.io/www/v10/v10-dark-landscape.gif\" alt=\"Demo\" />\n    <figcaption>\n      <p align=\"center\">\n        The client above is <strong>not</strong> importing any code from the server, only its type declarations.\n      </p>\n    </figcaption>\n  </figure>\n</div>\n\n## Introduction\n\n**NestJS tRPC** is a library designed to integrate the capabilities of tRPC into the NestJS framework. It aims to provide native support for decorators and implement an opinionated approach that aligns with NestJS conventions.\n\n## Features\n\n- ✅&nbsp; Supports most tRPC features out of the box with more to come.\n- 🧙‍&nbsp; Full static typesafety & autocompletion on the client, for inputs, outputs, and errors.\n- 🙀&nbsp; Implements the Nestjs opinionated approach to how tRPC works.\n- ⚡️&nbsp; Same client-side DX - We generate the AppRouter on the fly.\n- 🔋&nbsp; Examples are available in the ./examples folder.\n- 📦&nbsp; Out of the box support for **Dependency Injection** within the routes and procedures.\n- 👀&nbsp; Native support for `express`, `fastify`, and `zod` with more drivers to come!\n\n## Quickstart\n\n### Installation\n\nTo install **NestJS tRPC** with your preferred package manager, you can use any of the following commands:\n\n```shell\n# npm\nnpm install trpc-nestjs zod @trpc/server\n\n# pnpm\npnpm add trpc-nestjs zod @trpc/server\n\n# yarn\nyarn add trpc-nestjs zod @trpc/server\n```\n\n## How to use\n\nHere's a brief example demonstrating how to use the decorators available in **NestJS tRPC**:\n\n```typescript\n// users.router.ts\nimport { Inject } from '@nestjs/common';\nimport { Router, Query, UseMiddlewares } from 'trpc-nestjs';\nimport { UserService } from './user.service';\nimport { ProtectedMiddleware } from './protected.middleware';\nimport { TRPCError } from '@trpc/server';\nimport { z } from 'zod';\n\nconst userSchema = z.object({\n  name: z.string(),\n  password: z.string()\n})\n\n@Router()\nclass UserRouter {\n  constructor(\n    @Inject(UserService) private readonly userService: UserService\n  ) {}\n\n  @UseMiddlewares(ProtectedMiddleware)\n  @Query({ output: z.array(userSchema) })\n  async getUsers() {\n    try {\n      return this.userService.getUsers();\n    } catch (error: unknown) {\n      throw new TRPCError({\n        code: \"INTERNAL_SERVER_ERROR\",\n        message: \"An error has occured when trying to get users.\",\n        cause: error\n      })\n    }\n  }\n}\n```\n\n**👉 See full documentation on [NestJS-tRPC.io](https://nestjs-trpc.io/docs). 👈**\n\n## All contributors\n\n> NestJS tRPC is developed by [Kevin Edry](https://twitter.com/KevinEdry), which taken a huge inspiration from both NestJS and tRPC inner workings.\n\n<a href=\"https://github.com/KevinEdry/nestjs-trpc/graphs/contributors\">\n  <p align=\"center\">\n    <img width=\"720\" height=\"50\" src=\"https://contrib.rocks/image?repo=kevinedry/nestjs-trpc\" alt=\"A table of avatars from the project's contributors\" />\n  </p>\n</a>\n","readmeFilename":"README.md"}