Plugin Export Workflow
Figma's REST API currently restricts access to Variables (Tokens) for Pro, Starter, and Free plans. To bypass this limitation, CalibrateDS provides a companion Figma plugin.
The Workflow
The plugin securely extracts your variables and tokens from within Figma and exports them as a JSON file, which the CLI then consumes during its scan.
1. Export and Place the file
- Open your design system file in Figma.
- Run the CalibrateDS Figma plugin.
- Click Export Tokens.
- Save the generated JSON file as
imported-tokens.jsondirectly into the hidden.ptb/folder at the root of your project. (Note: On Mac, pressCmd + Shift + .to show hidden folders in Finder).
2. Sync with PTB
Run the CLI to merge the exported tokens with the standard REST API component data:
ptb scan
ptb generate-tokens
ptb generate-components
[!NOTE] You only need to re-export from the plugin when your Tokens or Variables change. If you are only updating component layouts or variants, a simple
ptb scanwill work!
Next Steps
Learn how to use PTB to scaffold your UI library in the Generation guide.