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
98.3
Supply Chain
96.5
Quality
97.6
Maintenance
100
Vulnerability
99.6
License
TypeScript (80.6%)
MDX (17.23%)
JavaScript (1.11%)
CSS (1.06%)
Total Downloads
63,336,646
Last Day
170,531
Last Week
810,975
Last Month
3,506,960
Last Year
35,097,365
MIT License
37,192 Stars
4,567 Commits
1,357 Forks
88 Watchers
43 Branches
458 Contributors
Updated on May 08, 2025
Minified
Minified + Gzipped
Latest Version
11.1.2
Package Id
@trpc/server@11.1.2
Unpacked Size
930.24 kB
Size
204.49 kB
File Count
405
NPM Version
lerna/8.1.2/node@v22.11.0+arm64 (darwin)
Node Version
22.11.0
Published on
Apr 29, 2025
Cumulative downloads
Total Downloads
Last Day
14.7%
170,531
Compared to previous day
Last Week
-3%
810,975
Compared to previous week
Last Month
3.6%
3,506,960
Compared to previous month
Last Year
58.2%
35,097,365
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 9 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
SAST tool detected but not run on all commits
Details
Reason
Found 8/17 approved changesets -- score normalized to 4
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
58 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-04-28
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