Skip to main content

Overview

@orion-js/trpc provides procedure helpers (queries, mutations, paginated queries), service decorators, and registerTRPCRoute to mount your router on Orion HTTP.

Install Dependencies

Server Setup

Type Inference Requirement

To get native transformer inference on client types (so httpBatchLink({transformer}) is accepted), enable strictNullChecks:

Error Formatting

@orion-js/trpc exports defaultErrorFormatter which enriches tRPC error shapes with Orionjs-specific data (validation errors, user error codes, permission errors). Use it with your own initTRPC instance:
You can also use mapErrorToTRPCError and getErrorData directly for custom error handling.

Server-Side Caller

Create a server-side caller for testing or internal use: