Skip to content

michaelstingl/figma-preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get rendered *.PNG from Figma node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages