github unnoq/orpc v1.7.0

latest releases: v1.8.6, v1.8.5, v1.8.4...
one month ago

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

   🐞 Bug Fixes

  • server: Add missing export for utils in standard adapter  -  by @unnoq (29120)
  • trpc: Add missing exports  -  by @unnoq (c465e)
    View changes on GitHub

Don't miss a new orpc release

NewReleases is sending notifications on new releases.