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.58%)
MDX (17.24%)
JavaScript (1.12%)
CSS (1.06%)
Total Downloads
57,867,834
Last Day
140,318
Last Week
789,296
Last Month
3,474,526
Last Year
33,282,071
MIT License
36,544 Stars
4,501 Commits
1,328 Forks
91 Watchers
37 Branches
449 Contributors
Updated on Mar 22, 2025
Minified
Minified + Gzipped
Latest Version
11.0.0
Package Id
@trpc/server@11.0.0
Unpacked Size
936.31 kB
Size
210.76 kB
File Count
415
NPM Version
lerna/8.1.2/node@v22.11.0+arm64 (darwin)
Node Version
22.11.0
Published on
Mar 21, 2025
Cumulative downloads
Total Downloads
Last Day
-0.3%
140,318
Compared to previous day
Last Week
-1.8%
789,296
Compared to previous week
Last Month
3.2%
3,474,526
Compared to previous month
Last Year
67%
33,282,071
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@next 3 4# Yarn 5yarn add @trpc/server@next 6 7# pnpm 8pnpm add @trpc/server@next 9 10# Bun 11bun add @trpc/server@next
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);
No vulnerabilities found.
Reason
30 commit(s) and 17 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
Found 12/17 approved changesets -- score normalized to 7
Reason
SAST tool detected but not run on all commits
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-10
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