Programmatically trigger a plugin

I’m using Figma to generate my invoices for my clients. I created a google sheet and I’m using the Google Sheets Sync plugin to sync the data. I also created a button in my google sheet that can be clicked to automatically export the figma component I want to PDF and store it in my google drive.

I would be great if I click the button in my sheet that it first uses the Figma REST API (or other) to trigger a sync of the plugin (and thus refresh the figma component with the correct data before exporting). That way the invoice generation would be completely automated. Anyone has an idea on how to do this?

Thanks!

You can’t click something outside of Figma to trigger a plugin inside Figma. REST API doesn’t have editing capabilities. So the only way would be to open the file and manually open the plugin to sync changes.