Safe Client docs
If you often use safe
for error handling, createSafeClient
can simplify your code by automatically wrapping all procedure calls with safe. It works with both server-side and client-side clients.
import { createSafeClient } from '@orpc/client'
const safeClient = createSafeClient(client)
const [error, data] = await safeClient.doSomething({ id: '123' })
Smart Coercion Plugin docs
Automatically converts input values to match schema types without manually defining coercion logic. This plugin can support almost any standard schema.
import { OpenAPIHandler } from '@orpc/openapi/fetch'
import {
experimental_SmartCoercionPlugin as SmartCoercionPlugin
} from '@orpc/json-schema'
const handler = new OpenAPIHandler(router, {
plugins: [
new SmartCoercionPlugin({
schemaConverters: [
new ZodToJsonSchemaConverter(), // <-- if you use Zod
new ValibotToJsonSchemaConverter(), // <-- if you use Valibot
new ArkTypeToJsonSchemaConverter(), // <-- if you use ArkType
],
})
]
})
Promote stable
aws lambda
, websocket
, message port
, zod 4 converter
now stable
🚀 Features
- client:
- json-schema:
- standard-server-aws-lambda:
- standard-server-peer:
- zod:
🐞 Bug Fixes
- server: Add missing export for utils in standard adapter - by @unnoq (29120)
- trpc: Add missing exports - by @unnoq (c465e)