API that provides the metadata of enabled libraries of a given file

My plugin needs to identify all libraries enabled for the current file. Currently, there is no Plugin API endpoint that provides this information.
I The Figma REST API can be used to identify libraries of the styles used in the file. However, this method has a couple of limitations:

  1. It is not possible to identify enabled libraries if none of their styles are currently in use in the file.
  2. Even if the API client has identified enabled libraries using the Figma REST API, they will not be able to detect changes to their enabled state. In other words, if the state of a library is changed to “disabled” in Figma’s UI, the API client will not be notified of this change.

A new Plugin API endpoint that lets clients know the metadata (file key, name, etc) of the libraries currently enabled for a given file would be very useful to expand Figma features to be more powerful.

Thank you.

2 Likes

+1. The figma.teamLibrary plugin API looks like a good fit for this. If the Figma team implemented a .getAvailableLibraries() or .getEnabledLibraries() method, I think we could use that in conjunction with a figma.on('documentchange') listener.

2 Likes