# @todesktop/plugin-ipc

> Communicating between desktop app windows.

Latest version **0.13.1** (published 2026-02-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install @todesktop/plugin-ipc
pnpm add @todesktop/plugin-ipc
yarn add @todesktop/plugin-ipc
bun add @todesktop/plugin-ipc
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.13.1 |
| Published | 2026-02-22 |
| First published | 2022-02-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 26.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | davej, megahertz, isaacaderogba |

## Links

- npm: https://www.npmjs.com/package/@todesktop/plugin-ipc
- Repository: https://github.com/ToDesktop/todesktop-ipc
- Homepage: https://github.com/ToDesktop/todesktop-ipc#readme
- Issues: https://github.com/ToDesktop/todesktop-ipc/issues
- npm.io page: https://npm.io/package/@todesktop/plugin-ipc

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2

## Recent versions

- 0.13.1 (latest) — 2026-02-22
- 0.13.0 — 2026-02-17
- 0.12.0 — 2026-02-17
- 0.11.0 — 2024-12-03
- 0.10.0 — 2024-12-02
- 0.9.0 — 2023-10-24
- 0.8.0 — 2023-05-24
- 0.7.0 — 2022-02-10
- 0.6.0 — 2022-02-07
- 0.5.0 — 2022-02-07
- 0.4.0 — 2022-02-07
- 0.3.0 — 2022-02-07
- 0.2.0 — 2022-02-07

## README

# ToDesktop IPC

Communicating between desktop app windows.

## Installation

Install `@todesktop/client-ipc` in your client-side application using

```sh
npm install @todesktop/client-ipc
```

Installation of the [plugin](https://www.npmjs.com/package/@todesktop/plugin-ipc) package is also necessary. Using ToDesktop Builder, navigate to **Plugins.** Click on the **Explore** button for "Selected Text" and install the package.

## Usage

### `subscribe`

Subscribes to a messaging channel and executes a callback when that message is triggered. The callback contains the `data` and `context` information from the sender.

You can also `unsubscribe` from a messaging channel by executing the function that is returned from the initial `subscribe` call.

```js
import { subscribe } from "@todesktop/client-ipc";

const unsubscribe = subscribe("foo", (data, context) => {
  console.log({ data, context });
  /**
   * {
   * 	data: { msg: "bar" },
   * 	context: { windowId: 2, viewId: 2 }
   * }
   */
});

// ...later
unsubscribe();
```

### `publish`

Publishes data to a messaging channel.

```js
import { publish } from "@todesktop/client-ipc";

publish("foo", { msg: "bar" });
```

### Logging

By default, the IPC plugin logs all events to the console. You can disable logging if needed:

```js
import { logging } from "@todesktop/client-ipc";

// Disable all IPC logging
logging.disable();

// Re-enable logging
logging.enable();

// Or set it conditionally
logging.set(process.env.NODE_ENV === "development");

// Check current state
console.log(logging.enabled); // true or false
```

### `identify`

Retrieves id information about the window and view.

```js
import { identify } from "@todesktop/client-ipc";

async () => {
  console.log(await identify());
  /**
   * {
   * 	windowId: 1,
   * 	viewId: 1
   * }
   */
};
```

---
_Source: https://npm.io/package/@todesktop/plugin-ipc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
