Skip to main content
Apr 19, 2024 4:45 PM UTC
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
Apr 19, 2024 4:59 PM UTC

You need to proxy it

M_L1Author
Apr 19, 2024 7:24 PM UTC

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
Apr 20, 2024 1:38 AM UTC

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

M_L1Author
Apr 20, 2024 5:16 AM UTC

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
Apr 20, 2024 7:47 AM UTC

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 6:12 PM UTC

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

May 18, 2024 2:40 AM UTC

If you are using NextJS, check out the link:

nextjs.org