https://github.com/davestewart/figma-messaging
Messaging library for Figma plugin developers
https://github.com/davestewart/figma-messaging
figma figma-api figma-plugins ipc message-bus
Last synced: about 1 year ago
JSON representation
Messaging library for Figma plugin developers
- Host: GitHub
- URL: https://github.com/davestewart/figma-messaging
- Owner: davestewart
- License: mit
- Created: 2024-07-25T20:19:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-02T08:42:29.000Z (almost 2 years ago)
- Last Synced: 2025-04-09T17:03:13.142Z (about 1 year ago)
- Topics: figma, figma-api, figma-plugins, ipc, message-bus
- Language: TypeScript
- Homepage:
- Size: 777 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Figma Messaging
> Messaging library for Figma plugin developers

_Example of processing spinner in [Figma Variables Starter](https://github.com/masha312/figma-variables-starter)._
## Overview
Figma Messaging is a two-way, await-able and type-safe replacement for Figma's [Messaging API](https://www.figma.com/plugin-docs/creating-ui/#sending-messages-between-the-ui-and-plugin-code).
It has a [simple but powerful](docs/README.md#usage) API and can be used in both `main` and `ui` processes:
```ts
// actions
const handlers = {
create () { ... },
update () { ... },
...
}
// incoming
const bus = makeBus(handlers)
// outgoing
bus.call('fooify', 'foo', 123, true)
```
Additionally, TypeScript users can opt-in to full [auto-complete](docs/bus.md#ide-auto-complete) functionality, including:
handler **ids**:

handler **parameters**:

handler **responses**:

Figma Messaging provides robust messaging capabilities for any [Figma Plugin](https://www.figma.com/plugin-docs/) with a build step.
## Next steps
- [Docs](./docs)
- [Demo](./demo)