Skip to main content
Question

CORS error for figma image


I keep getting this error when trying to GET a Figma frame image.

Access to image at ‘https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/[xxxxxxxx]’ from origin ‘[origin]’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
figma-alpha-api.s3.us-west-2.amazonaws.com/images/[xxxxxxxx]

why do i get this when i try to get the image resource from Figma? if i implicitly it from an it works fine… My origin is listed in My App, my crossOrigin is set correctly…

This topic has been closed for replies.

7 replies

Gleb
  • Power Member
  • 4710 replies
  • April 19, 2024

You need to proxy it


  • Author
  • 3 replies
  • April 19, 2024

only issue is that’s gotta have privacy implications for my users Figma stuff right? Are there proxy options that offer privacy?


Gleb
  • Power Member
  • 4710 replies
  • April 20, 2024

You can proxy through your own server: download an image on the server and send it to the client.


  • Author
  • 3 replies
  • April 20, 2024

Ah ok, yeah am gonna do that, but annoying as I then have to use up storage for a user’s Figma frames though.


Gleb
  • Power Member
  • 4710 replies
  • April 20, 2024

You don’t have to save them. Check out some guides for image proxy for your backend language of choice. Usually you just receive the request as a data stream and translate this stream right to the client.


Eli_Berger

Had the same issue solved it thru this article Building Interactive Figma Widgets | CSS-Tricks - CSS-Tricks


If you are using NextJS, check out the link:

nextjs.org

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