Skip to content
Back to skills

Orpc Web Workers

ASecurity

Type-safe oRPC communication between the main thread and Web Workers via the Message Port adapter.

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

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 12, 2026

npx -y skills add ali-master/skills --skill orpc-web-workers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orpc Web Workers?

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

Security grade badge for Orpc Web Workers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ali-master-orpc-web-workers/badge)](https://www.skillsdirectory.com/skills/ali-master-orpc-web-workers)

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 Web Workers Adapter
description: Type-safe oRPC communication between the main thread and Web Workers via the Message Port adapter.
license: MIT
metadata:
  author: Ali Torki
  homepage: https://github.com/ali-master
  version: "1.0.0"
---

# Web Workers Adapter

[Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Worker) run JavaScript in background threads, preventing UI blocking. Modern runtimes ([Bun](https://bun.com/docs/api/workers), [Deno](https://docs.deno.com/examples/web_workers/)) also support them.

With oRPC, you get type-safe communication channels between threads. See the [Message Port Adapter](/docs/adapters/message-port) for more context.

## Web Worker

```ts
import { RPCHandler } from '@orpc/server/message-port'
import { onError } from '@orpc/server'

const handler = new RPCHandler(router, {
  interceptors: [onError(error => console.error(error))],
})

handler.upgrade(self, {
  context: {},
})
```

## Main Thread

```ts
import { RPCLink } from '@orpc/client/message-port'

export const link = new RPCLink({
  port: new Worker('some-worker.ts'),
})
```

### Vite Web Workers

Vite has [first-class Web Workers support](https://vite.dev/guide/features.html#web-workers):

```ts
import SomeWorker from './some-worker.ts?worker'
import { RPCLink } from '@orpc/client/message-port'

export const link = new RPCLink({
  port: new SomeWorker(),
})
```

For full client examples, see [Client-Side Clients](/docs/client/client-side).

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.