# @univerjs/rpc-node

- Human documentation: [https://docs.univer.ai/reference/packages/plugins/univerjs/rpc-node](https://docs.univer.ai/reference/packages/plugins/univerjs/rpc-node)

- Agent Markdown: [https://docs.univer.ai/reference/packages/plugins/univerjs/rpc-node.md](https://docs.univer.ai/reference/packages/plugins/univerjs/rpc-node.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [packages/plugins/univerjs/rpc-node.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/packages/plugins/univerjs/rpc-node.mdx)

---

Node.js RPC plugins for Univer main-thread and worker communication.

```typescript
// [!code word:UniverRPCNodeMainPlugin]
import { fileURLToPath } from 'node:url'
import { UniverRPCNodeMainPlugin } from '@univerjs/rpc-node'

univer.registerPlugin(UniverRPCNodeMainPlugin, {
  workerSrc: fileURLToPath(new URL('./worker.js', import.meta.url)),
})
```

`workerSrc` is required when the main-thread plugin starts. Build the following worker entry separately and point `workerSrc` to its output.

```typescript
// [!code word:UniverRPCNodeWorkerPlugin]
import { UniverRPCNodeWorkerPlugin } from '@univerjs/rpc-node'

univer.registerPlugin(UniverRPCNodeWorkerPlugin)
```
