Skip to main content

I'm developing a Figma plugin that syncs library variables to local variables. I've noticed that when I call figma.teamLibrary.getAvailableLibraryVariableCollectionsAsync() multiple times, it seems to return cached results rather than fetching fresh data from the library.

This is causing issues when I update variables in the library and then try to sync them again - my plugin doesn't see the updated variables because it's getting cached data.

Example scenario:

  1. I run my plugin and sync variables from a library
  2. I update variables in the library
  3. I run my plugin again, but it doesn't see the updated variables

Questions:

  1. Is there a way to force getAvailableLibraryVariableCollectionsAsync() to bypass the cache and get fresh data?
  2. Is there a recommended approach for handling library variable updates in plugins?
  3. How long does this cache persist? Is it just for the current plugin session or longer?
  4. Are there any workarounds, like a different API method I should be using instead?

Any insights from the Figma team or other plugin developers would be greatly appreciated!

Be the first to reply!

Reply