Skip to main content

Hi there,


I am new to development and I recently released a simple plugin for generating a defined set of pages in Figma. I am working on the next release of it by adding a feature to let the user create, read, update and delete the list of names for pages so that the plugin can generate their personalized set of pages when they select the list and run the plugin. The list they create and save will just be a string.


From reading a lot of posts, the recommended API is figma.clientStorage which Iā€™m having a hard time figuring out how to use it. Can this only be used in the code.ts file? I tried using this code in code.js but Iā€™m getting the below error in the console:


Promise {<rejected>: 'Failed to set client storage key "key": Error: Cannot access client storage without a plugin ID'}


I am using the figsvelte plugin development boilerplate.


I was wondering if there are there are any other simple alternatives to store plugin data so that everytime a user runs the plugin, it has the data they saved?


Iā€™d really appreciate it if someone can explain in simple terms how to approach this.

Thanks!

figma.com

You can search and see examples of using this property on this forum, GitHub, etc.:

https://github.com/search?q=figma.clientStorage&type=code


Thank you so much for your responses! I will look at both of those plugin APIs.


Reply