Figma Embed Examples
This demonstrates how to embed Figma designs directly in your chalk content.
Simple Figma Embed
You can embed a Figma design by simply pasting the URL:
Figma Embed with Description and Caption
You can also add descriptions and captions to your Figma embeds:
Figma Embed with Custom Metadata
You can include custom metadata for organization and tracking:
How It Works
When you use a Figma URL in a chalk embed block:
- URL Parsing: The system extracts the file ID and node ID from the Figma URL
- API Fetching: Uses the Figma REST API to download the image (requires
FIGMA_ACCESS_TOKEN) - Caching: Downloaded images are cached locally to avoid repeated API calls
- Optimization: The Figma image goes through the same optimization pipeline as regular images
- Rate Limiting: Built-in rate limiting respects Figma’s API limits
Setup Requirements
To use Figma embeds, you need:
- A Figma access token set as the
FIGMA_ACCESS_TOKENenvironment variable - The Figma file must be publicly accessible or you must have access with your token
- The URL must include a
node-idparameter pointing to a specific node
Supported URL Formats
The following Figma URL formats are supported:
https://www.figma.com/design/FILE_ID/NAME?node-id=NODE_IDhttps://www.figma.com/file/FILE_ID/NAME?node-id=NODE_IDhttps://figma.com/design/FILE_ID/NAME?node-id=NODE_ID
Additional URL parameters (like t= for tokens) are preserved but not required.