server-side-calls
OfficialCall tRPC procedures directly from server
Software Engineering#trpc#integration-testing#error-handling#server-side#api-endpoints#trpcerror#createcaller
AuthorPlazaCC
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This guide explains how to invoke tRPC procedures directly from server code to run integration tests, implement internal server logic, and expose server-only API endpoints without an HTTP layer.
Core Features & Use Cases
- Direct caller creation: Use createCallerFactory or router.createCaller to invoke procedures with a fully-formed server context.
- Integration testing: Execute procedures in tests with simulated contexts to validate behavior without running an HTTP server.
- Error handling for APIs: Catch TRPCError and map it to HTTP status codes using getHTTPStatusCodeFromError and optionally observe errors with onError callbacks.
- Best practices: Avoid creating callers inside procedures; extract shared logic into plain functions and supply proper context when calling protected routes.
Quick Start
Create a caller with createCallerFactory using a test context that includes a simulated user and call post.list to retrieve posts.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: server-side-calls Download link: https://github.com/PlazaCC/antes-da-tela/archive/main.zip#server-side-calls Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.