Skip to main content
Question

How to trigger a plugin from the code?


Alex_Mir

Context
We want to keep our translations in the Figma variables and sync them across the codebase. To do so I use variables2json plugin which saves a nice json on the machine so I am able to use it in the code.

Issue
We need to trigger the plugin manually to get the translations to the local env. Then we need to store them in the repo (which we do not want to do) because CI is not able to pull the latest translations from Figma.

Question
How could we trigger the plugin from the codebase? That will allow us to do so during the building process on the local env and on the CI env too. Theoretically, it will almost fully automate the translations process with maintaining only one source of truth: Figma with its translations stored in variables

This topic has been closed for replies.

2 replies

I have the same question! But seems Figma doesn’t support it. @Alex_Mir


tank666
  • 4873 replies
  • March 4, 2024

Plugins can only be run by the user in an open file. Therefore, you should consider using the REST API, provided you have the Enterprise plan. More details in the documentation:
https://www.figma.com/developers/compare-apis
https://www.figma.com/developers/api#variables


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings