Most of the plugin API is accessible from this single global object. This includes functions to create nodes, access the current selection, open a modal, and much more.
Tip: in addition to being available in your plugin, we have also added this global object to every Figma editor window. This means you can open up the developer console in any Figma editor window and use the figma API directly just as you would any other browser API by typing in a line of code and pressing enter. You don’t have to write a plugin at all to do this. This is a really powerful way to experience the API for yourself in an interactive environment as well as debug issues with using the Figma plugin API.
This is the one additional global variable available in your plugin code. If you assigned a file name to the
"ui" field in your
manifest.json file, the contents of that file will be accessible through this variable within your plugin code. This lets you call