Skip to content
Back to skills

Orpc Server Side

ASecurity

Call your oRPC procedures in the same environment as your server like native functions.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
toolsgit

Works with

  • cli

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-server-side --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Server Side?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orpc Server Side
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-server-side/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-server-side)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: oRPC Server-Side Clients
description: Call your oRPC procedures in the same environment as your server like native functions.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Server-Side Clients

Call your [procedures](/docs/procedure) in the same environment as your server, no proxies required, like native functions.

## Calling Procedures

### Using `.callable`

```ts
import { os } from '@orpc/server'
import * as z from 'zod'

const getProcedure = os
  .input(z.object({ id: z.string() }))
  .handler(async ({ input }) => ({ id: input.id }))
  .callable({
    context: {} // Initial context if needed
  })

const result = await getProcedure({ id: '123' })
```

### Using the `call` Utility

```ts
import * as z from 'zod'
import { call, os } from '@orpc/server'

const getProcedure = os
  .input(z.object({ id: z.string() }))
  .handler(async ({ input }) => ({ id: input.id }))

const result = await call(getProcedure, { id: '123' }, {
  context: {}
})
```

## Router Client

```ts
import { createRouterClient, os } from '@orpc/server'

const ping = os.handler(() => 'pong')
const pong = os.handler(() => 'ping')

const client = createRouterClient({ ping, pong }, {
  context: {}
})

const result = await client.ping()
```

### Client Context

```ts
interface ClientContext { cache?: boolean }

const ping = os.handler(() => 'pong')
const pong = os.handler(() => 'ping')

const client = createRouterClient({ ping, pong }, {
  context: ({ cache }: ClientContext) => {
    if (cache) return {} // context when cache enabled
    return {} // context when cache disabled
  }
})

const result = await client.ping(undefined, { context: { cache: true } })
```

## Lifecycle

```mermaid
sequenceDiagram
  actor A1 as Client
  participant P1 as Error Validator
  participant P2 as Input/Output Validator
  participant P3 as Handler

  A1 ->> P2: input, signal, lastEventId
  P2 ->> P2: Validate Input
  P2 ->> P3: validated input
  P3 ->> P3: handle
  P3 ->> P2: error/output
  P2 ->> P2: validate output
  P2 ->> P1: validate error
  P1 ->> A1: validated error/output
```

### Middlewares Order

Apply this to ensure all middlewares run after input validation and before output validation:

```ts
const base = os.$config({
  initialInputValidationIndex: Number.NEGATIVE_INFINITY,
  initialOutputValidationIndex: Number.NEGATIVE_INFINITY,
})
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.