This playbook outlines the steps taken to export design assets from a Figma file to specified format using the Figma API.
- Personal access token from Figma with the necessary scopes.
- The Figma file URL or key.
curl
andjq
installed on the local machine.- A bash shell environment.
Use the personal access token to authenticate API requests. The token is used in the header of the curl requests.
Make an API call to retrieve the JSON structure of the Figma file using the file key.
Use jq
to parse the JSON structure and extract the node IDs for the frames or layers to be exported.
Construct an API call to the Figma API's GET /v1/images/:file_key
endpoint, passing the node IDs as parameters and specifying the format as specified.
Write a bash script to download all the specified format images from the provided URLs and save them in a directory with their node IDs as filenames.
Check the downloaded files for correct format and quality. Ensure they match the original design assets in the Figma file.
Report the completion of the task to the user with details of the exported files. Provide the files for user verification.
- Do not overwrite files without permission.
- Refer to the Figma API documentation for detailed information on API endpoints and export settings.
- Adjust export settings via API as needed: file name, resolution, scaling.
- Verify exported files for correct format and quality before final delivery.
- Test exported files in intended environment (e.g., web, print).