Setting editor type
The Plugin API has both read and write functions, allowing developers to view, create, and modify the contents of Figma design and FigJam files. You can create plugins for a specific editor type, both editors, or build plugins that perform different actions in each editor.
We’ve added a new field in the manifest that allows you to specify which editor you are building a plugin for. This field can include a singular type, or both editor types:
"editorType": [
"figjam",
"figma"
],
Keep in mind, when you specify an editor type of both figma
and figjam
, your plugin won’t have access to certain functions and events depending on the editor the plugin runs in. For example, if you use figma.createSticky()
, the code will work while the plugin is running in FigJam, but not when you run it in Figma. Learn more about what the Plugin API supports for each editor →
If you want to set conditional logic in your plugin to assign behavior based on the editor running the plugin, you can use the method figma.editorType
. This will return a string value of either figma
or figjam
.
if (figma.editorType === figjam) {
figma.createShapeWithText();
}