Lets you store custom information on any node or style, private to your plugin.
setPluginData(key: string, value: string): void
The key under which to store the data. This is similar to writing to a plain object via
obj[key] = value.
The data you want to store. If you want to store a value type other than a string, encode it as a JSON string first via
JSON.parse. If you set the value to the empty string (""), the key/value pair is removed.
The data is specific to your plugin ID. Plugins with other IDs won't be able to read this data. You can retrieve it later by calling
getPluginData with the same key. To find all data stored on a node or style by your plugin use
⚠ The data is stored privately for stability, not security. It prevents other plugins from accessing with your data. It does not, however, prevent users from seeing the data given sufficient effort. For example, they could export the document as a .fig file and try to decode it.
⚠ Data will become inaccessible if your plugin ID changes.