Skip to content
Back to skills

Orpc Request Headers

ASecurity

Access request headers in oRPC.

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

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-request-headers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Request Headers?

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

Security grade badge for Orpc Request Headers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-request-headers/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-request-headers)

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 Request Headers Plugin
description: Access request headers in oRPC.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Request Headers Plugin

Injects a `reqHeaders` instance into the `context`, enabling you to read incoming request headers.

## Context Setup

```ts
import { getCookie } from '@orpc/server/helpers'
import { RequestHeadersPluginContext } from '@orpc/server/plugins'

interface ORPCContext extends RequestHeadersPluginContext {}

const base = os.$context<ORPCContext>()

const example = base
  .use(({ context, next }) => {
    const sessionId = getCookie(context.reqHeaders, 'session_id')
    return next()
  })
  .handler(({ context }) => {
    const userAgent = context.reqHeaders?.get('user-agent')
    return { userAgent }
  })
```

> `reqHeaders` can be `undefined` to allow procedures to run safely without `RequestHeadersPlugin`, such as in direct calls.

> Combine with [Cookie Helpers](/docs/helpers/cookie) for streamlined cookie management.

## Handler Setup

```ts
import { RequestHeadersPlugin } from '@orpc/server/plugins'

const handler = new RPCHandler(router, {
  plugins: [new RequestHeadersPlugin()],
})
```

> The `handler` can be any supported oRPC handler.

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.