Home

Awesome

figma-JSONRPC

Leverage JSON-RPC to communicate between your Figma plugin and your Figma UI.

Installation

npm install figma-jsonrpc

Usage

The typescript definition of the API is automatically inferred from the methods passed to rpc :sparkles:.

:warning: You always need to import the API in both the plugin and the UI, even if you aren't using it. It is necessary so that both part can handle calls from each other.

One more thing...

Using React? There are a couple of treats for you.

Two React hooks you can use in your UI which will setup the necessary APIs for you.

In both cases, you also need to import figma-jsonrpc/hooks/* in your plugin to create the APIs.

License

MIT