Skip to main content
April 19, 2024
Question

CORS error for figma image

  • April 19, 2024
  • 7 replies
  • 1516 views

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
April 19, 2024

You need to proxy it

M_L1Author
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
April 20, 2024

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

M_L1Author
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
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
May 14, 2024

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

May 18, 2024

If you are using NextJS, check out the link:

nextjs.org