🚀 Quick Setup Guide
Get Started in 5 Minutes
1. Install Dependencies
cd scripts
npm install
2. Get Figma Access Token
- Go to Figma Settings
- Navigate to "Personal access tokens"
- Create a new token with read permissions
- Copy the token
3. Set Environment Variable
export FIGMA_ACCESS_TOKEN="your_token_here"
4. Test the System
npm run test
5. Capture Your Designs
# Capture all portals
npm run figma:all
# Or capture specific portals
npm run figma:parents
npm run figma:providers
🎯 What You'll Get
After running the capture script, you'll have:
- 📸 Screenshots - High-resolution images of all screens
- 📊 Metadata - Complete screen information and relationships
- 📝 Documentation - Auto-generated Markdown documentation
- 🖼 Thumbnails - Optimized images for documentation
📁 Output Location
All files are saved to docs/design-system/:
screenshots/- High-res screenshots by portalthumbnails/- Thumbnail imagesmetadata.json- Screen metadatadocumentation.md- Generated documentation
🔧 Configuration
Add New Portals
Edit figma-capture.js and add your file keys:
files: {
parents: 'YOUR_FIGMA_FILE_KEY',
providers: 'YOUR_FIGMA_FILE_KEY',
public: 'your_public_file_key', // Add this
mobile: 'your_mobile_file_key' // Add this
}
Customize Output
Edit the CONFIG object in figma-capture.js:
- Image format and scale
- Output directories
- Thumbnail size
🆘 Troubleshooting
Common Issues
"FIGMA_ACCESS_TOKEN environment variable is required"
- Set the token:
export FIGMA_ACCESS_TOKEN="your_token"
"No file key configured for [portal] portal"
- Add the file key to
CONFIG.filesinfigma-capture.js
"Error fetching Figma file"
- Check file permissions in Figma
- Verify the file key is correct
📞 Need Help?
- Check the full README for detailed instructions
- Review Figma API documentation
- Create an issue in the repository
🎉 You're all set! Run npm run figma:test to verify everything works, then npm run figma:all to capture your designs.