
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@eviloma/nestjs-trpc
Advanced tools
<source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/JvsOXCg.png" />
The client above is not importing any code from the server, only its type declarations.
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.
express, fastify, and zod with more drivers to come!To install NestJS tRPC with your preferred package manager, you can use any of the following commands:
# npm
npm install @eviloma/trpc-nestjs zod @trpc/server
# pnpm
pnpm add @eviloma/trpc-nestjs zod @trpc/server
# yarn
yarn add @eviloma/trpc-nestjs zod @trpc/server
Here's a brief example demonstrating how to use the decorators available in NestJS tRPC:
// users.router.ts
import { Inject } from '@nestjs/common';
import { Router, Query, UseMiddlewares } from 'trpc-nestjs';
import { UserService } from './user.service';
import { ProtectedMiddleware } from './protected.middleware';
import { TRPCError } from '@trpc/server';
import { z } from 'zod';
const userSchema = z.object({
name: z.string(),
password: z.string()
})
@Router()
class UserRouter {
constructor(
@Inject(UserService) private readonly userService: UserService
) {}
@UseMiddlewares(ProtectedMiddleware)
@Query({ output: z.array(userSchema) })
async getUsers() {
try {
return this.userService.getUsers();
} catch (error: unknown) {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: "An error has occured when trying to get users.",
cause: error
})
}
}
}
👉 See full documentation on NestJS-tRPC.io. 👈
This documentation for original nestjs-trpc, but you can use it with TRPC 11 and Zod 4.
NestJS tRPC is developed by Kevin Edry, which taken a huge inspiration from both NestJS and tRPC inner workings.
FAQs
<source media="(prefers-color-scheme: dark)" srcset="https://i.imgur.com/JvsOXCg.png" />
We found that @eviloma/nestjs-trpc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.