Lets you store custom information on any node, 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
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.
⚠ The data is stored privately for stability, not security. It prevents other plugins from tampering with your data model. 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.