Figma clientStorage quota exceeded

I’m trying to add data into clientStorage with ‘setAsync’. Here is the steps :

  1. call setAsync → set data with key1 and value. (80kb)
  2. call setAsync → set data with key1 with new value(830kb)
    then, error pops out that ‘clientStorage quota exceeded for this Plugin Id’.

Q. does the setAsync override the previous clientStorage key1 data with new key1 data?
for both data is under the 1MB, not sure why we gets this error.

      figma.clientStorage.setAsync(key1, value);

second attempt I have tried,

  • figma.clientStorage.deleteAsync(‘key1’).then( ()=> figma.clientStorage.setAsync(‘key1’,value) })

This code also returns the same warning and did not set the data into clientStorage.

1 Like

The 1Mb storage limit is not per key but for all the keys

Here some code to log all your stored data :

figma.clientStorage.keysAsync().then((keys) =>
  keys.forEach((key) => {
    figma.clientStorage.getAsync(key).then((data) => console.log([key, data]));

You can also try to erase first the data stored before storing a new one!
I do not know if it would work but would be interested with the outcome
Tell me if it worked please :slight_smile:

Thank you for the response. Unfortunately, code does not solve the problem. I ran the keys and was able to see the all the ‘keys’. However, every time, I ‘setAsync’ data into clientStorage, It throws the same warning. It only works with really small amount of data. I tested to save only ‘83KB’ file into storage and it gets the warning as well, but did not get an error with small size of code. ex) {data:’ new Data’}