Skip to main content

Cannot api calls without iframe?


WATCHA

I tried to make api call with axios inside main plugin file.
but It seems not work and it’s very annoying.

3 replies

Gleb
  • Power Member
  • 4706 replies
  • July 7, 2021

Relevant page from the docs:

figma.com

meisiu.lei

@Gleb
but it seems like I am only able to make a network request if I run figma.ui.postMessage({ type: 'networkRequest' }); directly in the main thread. It doesn’t work anywhere else. Making a XMLHttpRequest in a onclick callback also doesn’t work. It’s not that useful if I can’t make a network request when the user clicks a button in the plugin window. Any solution?


Gleb
  • Power Member
  • 4706 replies
  • July 13, 2021

You don’t need that part if you want to make a request when the user clicks a button. Just do it the normal JS way.


Reply


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