Skip to content
Back to skills

Orpc Publish To Npm

ASecurity

How to publish your oRPC client to NPM as an SDK.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 12, 2026
developmenttypescriptbashgitapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-publish-to-npm --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Publish To Npm?

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

Security grade badge for Orpc Publish To Npm
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-publish-to-npm/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-publish-to-npm)

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 Publish Client to NPM
description: How to publish your oRPC client to NPM as an SDK.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Publish Client to NPM

Publishing your oRPC client to NPM allows users to easily consume your APIs as an SDK.

## Prerequisites

A project already set up with oRPC. [Contract First](/docs/contract-first/define-contract) is the preferred approach.

## Export & Scripts

```ts
// src/index.ts
import { createORPCClient } from '@orpc/client'
import { RPCLink } from '@orpc/client/fetch'
import type { ContractRouterClient } from '@orpc/contract'

export function createMyApi(apiKey: string): ContractRouterClient<typeof contract> {
  const link = new RPCLink({
    url: 'https://example.com/rpc',
    headers: { 'x-api-key': apiKey }
  })

  return createORPCClient(link)
}
```

```json
{
  "name": "<package-name>",
  "type": "module",
  "version": "0.0.0",
  "publishConfig": { "access": "public" },
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.js",
      "default": "./dist/index.js"
    }
  },
  "files": ["dist"],
  "scripts": {
    "build": "tsdown --dts src/index.ts",
    "release": "pnpm publish"
  },
  "dependencies": {
    "@orpc/client": "...",
    "@orpc/contract": "..."
  },
  "devDependencies": {
    "tsdown": "latest",
    "typescript": "latest"
  }
}
```

## Build & Publish

```bash
pnpm login
pnpm run build
pnpm run release
```

## Install & Use

```bash
pnpm add "<package-name>"
```

```ts
import { createMyApi } from '<package-name>'

const myApi = createMyApi('your-api-key')

const output = await myApi.someMethod('input')
```

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.