A Figma plugin that automatically fetches, analyzes, and summarizes comments in a Figma design file or FigJam board using Anthropic's Claude API.
- OAuth 2.0 authentication with PKCE for secure Figma API access
- Comment fetching from active Figma file using REST API
- Basic comment summarization using Claude 3.5 Sonnet
- Simple UI with summarization button and loading state
- Error handling for authentication and API failures
- Comment categorization by type (design critique, bug report, etc.)
- Sentiment analysis of comments
- Tagging of actionable items
- Copy summary button
- Advanced error handling for rate limits
- Comment filtering options (e.g., resolved vs. unresolved)
-
Authentication Flow
- Plugin checks for existing OAuth token
- If no token exists, initiates PKCE OAuth flow
- Securely stores token in Figma client storage
-
Comment Analysis Flow
- User clicks "Summarize Comments" button
- Plugin fetches comments using Figma REST API
- Comments are sent to backend server
- Backend processes comments using Claude API
- Summary is displayed in plugin UI
- Node.js (v14 or higher)
- npm (comes with Node.js)
- A Figma account
- An Anthropic API key
-
Clone the repository and install dependencies
git clone [your-repo-url] cd figma-comment-analyzer npm install -
Configure environment variables Create a
.envfile in the root directory with:FIGMA_CLIENT_SECRET=your_figma_client_secret ANTHROPIC_API_KEY=your_anthropic_api_key -
Start the local server
npm start
The server will run on http://localhost:3000
-
Load the plugin in Figma
- Open Figma Desktop app
- Go to Menu > Plugins > Development > Import plugin from manifest...
- Select the
manifest.jsonfile from this project - The plugin will appear in your development plugins list
- Open a Figma file with comments
- Run the plugin from Plugins > Development > Figma Comment Analyzer
- Click "Summarize Comments" in the plugin UI
- If prompted, authorize the plugin to access your Figma account
- Wait for the summary to appear
- Frontend: HTML/CSS/JS (
ui.html) for plugin interface - Plugin Logic: (
code.js) handles Figma API integration and OAuth flow - Backend: Node.js (
server.js) manages Anthropic API calls and token exchange
manifest.json: Plugin configuration and permissionscode.js: Core plugin logic and Figma API integrationserver.js: Backend server for API handlingui.html: Plugin user interface
- If you see CORS errors, ensure the server is running on port 3000
- If authentication fails, check your Figma client secret
- If summarization fails, verify your Anthropic API key
- For OAuth issues, ensure your Figma client ID and redirect URI are correct
- OAuth 2.0 with PKCE is implemented for secure authentication
- API keys are stored server-side only
- Figma client storage is used for token management
[Your chosen license]
Currently experiencing an issue with the OAuth flow:
-
Symptoms:
- Browser window opens correctly for Figma authorization
- "Allow Access" button click doesn't complete the OAuth flow
- No error message appears in the plugin UI
- Console shows successful code verifier/challenge generation
-
Debug Information:
- Console logs show code verifier and challenge are generated
- OAuth window opens with correct parameters
- Callback handling appears to fail silently
-
Possible Causes:
- Mismatch between redirect URI in code and Figma app settings
- Message passing between OAuth window and plugin may be failing
- CORS settings may need adjustment
-
Temporary Workaround: None available yet. Investigation ongoing.
-
Next Debug Steps:
- Verify redirect URI matches exactly in all locations
- Add additional logging in OAuth callback handler
- Check browser console in OAuth window for errors
- Verify CORS settings in server.js