Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 2.14 KB

README.md

File metadata and controls

42 lines (27 loc) · 2.14 KB

figma-preview

Get rendered *.PNG from Figma node using the Figma API

This is only a PoC for local testing. It is not recommended to run in production!!!

Run local:

git clone https://github.com/michaelstingl/figma-preview.git
cd figma-preview
sed -i -e 's/XX-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/replace-with-your-personal-access-token/g'  index.php
php -S localhost:8080

Return image data:

http://localhost:8080/?file=Ui4YzD3oQcxJSbzBEr80O9eU&node-id=18:646&format=.png

Return $imageUrl as text:

http://localhost:8080/?file=Ui4YzD3oQcxJSbzBEr80O9eU&node-id=18:646&format=.debug

Demo (live embeds)

Image 1/3 Image 2/3 Image 3/3
Source: Figma URL Source: Figma URL Source: Figma URL

Notes about image handling on GitHub.com

If you upload an image to GitHub, the URL of the image will be modified so your information is not trackable.

To host your images, GitHub uses the open-source project Camo. Camo generates an anonymous URL proxy for each image that starts with https://camo.githubusercontent.com/ and hides your browser details and related information from other users.

Anyone who receives your anonymized image URL, directly or indirectly, may view your image. To keep sensitive images private, restrict them to a private network or a server that requires authentication instead of using Camo.

Source: https://help.github.com/articles/about-anonymized-image-urls/

Special thanks