Socket
Book a DemoInstallSign in
Socket

figma-messaging

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

figma-messaging

Messaging library for Figma plugin developers

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
0
Created
Source

Figma Messaging

Messaging library for Figma plugin developers

Overview

Figma Messaging is a type-safe, auto-completing wrapper for Figma's Messaging API.

Set up correctly, it can auto-complete...

...handler ids:

screenshot

...handler parameters:

screenshot

...handler responses:

screenshot

You can use Figma Messaging in any Figma Plugin for robust, two-way messaging between main and ui processes.

Services

The package comprises two services, ipc and bus:

ipc is a low-level inter-process communication service which provides:

  • two-way communication between main and ui processes
  • awaitable call and response
  • catchable errors
  • optional logging

bus is a higher-level message bus service (which wraps ipc) to provide:

  • a formalised routing and handler setup
  • IDE auto-completion of known route names and parameters
  • typed parameter and return data for known routes
  • flexibility to call arbitrary / unknown routes
  • fallback handler for arbitrary / unknown routes

Generally, bus will be your first choice as it's more feature-rich and user-friendly.

Demo

To see real-world code, or to build and run a demo plugin live in Figma, check out the demo folder.

Next steps

Keywords

figma

FAQs

Package last updated on 29 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts