Skip to content
Back to skills

Orpc Response Headers

ASecurity

Set response headers in oRPC.

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

Security analysis

A100/100

Scanned September 12, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Orpc Response Headers?

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

Security grade badge for Orpc Response Headers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-response-headers/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-response-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 Response Headers Plugin
description: Set response headers in oRPC.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Response Headers Plugin

Injects a `resHeaders` instance into the `context`, enabling you to modify response headers.

## Context Setup

```ts
import { setCookie } from '@orpc/server/helpers'
import { ResponseHeadersPluginContext } from '@orpc/server/plugins'

interface ORPCContext extends ResponseHeadersPluginContext {}

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

const example = base
  .use(({ context, next }) => {
    context.resHeaders?.set('x-custom-header', 'value')
    return next()
  })
  .handler(({ context }) => {
    setCookie(context.resHeaders, 'session_id', 'abc123', {
      secure: true,
      maxAge: 3600
    })
  })
```

> `resHeaders` can be `undefined` to allow procedures to run safely without the plugin (e.g., direct calls).

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

## Handler Setup

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

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

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.