Gathering detailed insights and metrics for @trpc/server
Gathering detailed insights and metrics for @trpc/server
Gathering detailed insights and metrics for @trpc/server
Gathering detailed insights and metrics for @trpc/server
🧙♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.
npm install @trpc/server
Typescript
Module System
Node Version
NPM Version
96.6
Supply Chain
96.5
Quality
97.6
Maintenance
100
Vulnerability
99.6
License
TypeScript (80.91%)
MDX (16.97%)
JavaScript (1.09%)
CSS (1.03%)
Total Downloads
66,542,658
Last Day
65,599
Last Week
947,842
Last Month
3,900,794
Last Year
36,229,615
MIT License
37,721 Stars
4,630 Commits
1,381 Forks
89 Watchers
48 Branches
472 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
11.4.3
Package Id
@trpc/server@11.4.3
Unpacked Size
1.84 MB
Size
445.44 kB
File Count
270
NPM Version
lerna/8.1.2/node@v22.11.0+arm64 (darwin)
Node Version
22.11.0
Published on
Jun 27, 2025
Cumulative downloads
Total Downloads
Last Day
17%
65,599
Compared to previous day
Last Week
-1.1%
947,842
Compared to previous week
Last Month
12.7%
3,900,794
Compared to previous month
Last Year
54.2%
36,229,615
Compared to previous year
1
End-to-end typesafe APIs made easy
@trpc/server
Create tRPC routers and connect them to a server.
Full documentation for @trpc/server
can be found here
1# npm 2npm install @trpc/server 3 4# Yarn 5yarn add @trpc/server 6 7# pnpm 8pnpm add @trpc/server 9 10# Bun 11bun add @trpc/server
We also recommend installing zod
to validate procedure inputs.
1import { initTRPC } from '@trpc/server'; 2import { 3 CreateHTTPContextOptions, 4 createHTTPServer, 5} from '@trpc/server/adapters/standalone'; 6import { z } from 'zod'; 7 8// Initialize a context for the server 9function createContext(opts: CreateHTTPContextOptions) { 10 return {}; 11} 12 13// Get the context type 14type Context = Awaited<ReturnType<typeof createContext>>; 15 16// Initialize tRPC 17const t = initTRPC.context<Context>().create(); 18 19// Create main router 20const appRouter = t.router({ 21 // Greeting procedure 22 greeting: t.procedure 23 .input( 24 z.object({ 25 name: z.string(), 26 }), 27 ) 28 .query(({ input }) => `Hello, ${input.name}!`), 29}); 30 31// Export the app router type to be imported on the client side 32export type AppRouter = typeof appRouter; 33 34// Create HTTP server 35const { listen } = createHTTPServer({ 36 router: appRouter, 37 createContext, 38}); 39 40// Listen on port 2022 41listen(2022);
0/10
Summary
tRPC 11 WebSocket DoS Vulnerability
Affected Versions
>= 11.0.0, < 11.1.1
Patched Versions
11.1.1
Reason
30 commit(s) and 17 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
Found 21/30 approved changesets -- score normalized to 7
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More