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
Source: Figma URL | Source: Figma URL | Source: Figma URL |
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/
- @patrickjahns helping with
json_decode
and resilience