{"id":17492928,"url":"https://github.com/kevinedry/nestjs-trpc","last_synced_at":"2026-02-16T04:05:32.634Z","repository":{"id":217783842,"uuid":"622135155","full_name":"KevinEdry/nestjs-trpc","owner":"KevinEdry","description":"Providing native support for decorators and implement an opinionated approach that aligns with NestJS conventions.","archived":false,"fork":false,"pushed_at":"2026-02-13T16:17:00.000Z","size":2027,"stargazers_count":301,"open_issues_count":3,"forks_count":27,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-14T00:51:59.958Z","etag":null,"topics":["api","express","nestjs","trpc","typescript"],"latest_commit_sha":null,"homepage":"https://NestJS-tRPC.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KevinEdry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-01T08:15:46.000Z","updated_at":"2026-02-13T16:16:20.000Z","dependencies_parsed_at":"2026-01-29T20:04:31.943Z","dependency_job_id":null,"html_url":"https://github.com/KevinEdry/nestjs-trpc","commit_stats":null,"previous_names":["kevinedry/nestjs-trpc"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/KevinEdry/nestjs-trpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinEdry%2Fnestjs-trpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinEdry%2Fnestjs-trpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinEdry%2Fnestjs-trpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinEdry%2Fnestjs-trpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KevinEdry","download_url":"https://codeload.github.com/KevinEdry/nestjs-trpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KevinEdry%2Fnestjs-trpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","express","nestjs","trpc","typescript"],"created_at":"2024-10-19T11:07:57.450Z","updated_at":"2026-02-16T04:05:32.609Z","avatar_url":"https://github.com/KevinEdry.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://nestjs-trpc.io/\" target=\"_blank\" rel=\"noopener\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://i.imgur.com/JvsOXCg.png\" /\u003e\n    \u003cimg alt=\"tRPC\" src=\"https://i.imgur.com/JvsOXCg.png\" /\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eNestjs tRPC Adapter\u003c/h1\u003e\n  \u003ch3\u003eAn opinionated approach to building\u003cbr /\u003eEnd-to-end typesafe APIs with tRPC within NestJS.\u003c/h3\u003e\n  \u003ca href=\"https://npmcharts.com/compare/nestjs-trpc?interval=30\"\u003e\n    \u003cimg alt=\"weekly downloads\" src=\"https://img.shields.io/npm/dm/nestjs-trpc.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/KevinEdry/nestjs-trpc/blob/main/LICENSE\"\u003e\n    \u003cimg alt=\"MIT License\" src=\"https://img.shields.io/github/license/KevinEdry/nestjs-trpc\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/trpc-867764511159091230\"\u003e\n    \u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/867764511159091230?color=7389D8\u0026label\u0026logo=discord\u0026logoColor=ffffff\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003cfigure\u003e\n    \u003cimg src=\"https://i.imgur.com/bttfbmF.gif\" alt=\"Demo\" /\u003e\n    \u003cfigcaption\u003e\n      \u003cp align=\"center\"\u003e\n        The client above is \u003cstrong\u003enot\u003c/strong\u003e importing any code from the server, only its type declarations.\n      \u003c/p\u003e\n    \u003c/figcaption\u003e\n  \u003c/figure\u003e\n\u003c/div\u003e\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- Fast Rust-based CLI for type generation with rich error messages\n- Full static typesafety \u0026 autocompletion on the client, for inputs, outputs, and errors\n- Implements the NestJS opinionated approach to how tRPC works\n- Watch mode for auto-regeneration during development\n- Out of the box support for **Dependency Injection** within the routes and procedures\n- Native support for `express`, `fastify`, and `zod` with more drivers to come\n- Examples are available in the ./examples folder\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# bun\nbun add nestjs-trpc zod @trpc/server\n\n# npm\nnpm install nestjs-trpc zod @trpc/server\n\n# pnpm\npnpm add nestjs-trpc zod @trpc/server\n\n# yarn\nyarn add nestjs-trpc zod @trpc/server\n```\n\n### Generate Types\n\nRun the CLI to generate your AppRouter types:\n\n```shell\n# Generate types (one-time)\nnpx nestjs-trpc generate\n\n# Watch mode for development\nnpx nestjs-trpc watch\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 'nestjs-trpc';\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\u003e 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\u003ca href=\"https://github.com/KevinEdry/nestjs-trpc/graphs/contributors\"\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg width=\"720\" height=\"50\" src=\"https://contrib.rocks/image?repo=kevinedry/nestjs-trpc\" alt=\"A table of avatars from the project's contributors\" /\u003e\n  \u003c/p\u003e\n\u003c/a\u003e\n\n## Release Process\n\nFor maintainers, see [Release Checklist](./docs/docs/RELEASE_CHECKLIST.md) for the v2.0.0 release process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinedry%2Fnestjs-trpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinedry%2Fnestjs-trpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinedry%2Fnestjs-trpc/lists"}