{"id":32309003,"url":"https://github.com/arnemolland/figma","last_synced_at":"2026-02-21T02:40:04.676Z","repository":{"id":42662200,"uuid":"370148477","full_name":"arnemolland/figma","owner":"arnemolland","description":"Figma API client written in pure Dart","archived":false,"fork":false,"pushed_at":"2026-02-09T22:18:47.000Z","size":1028,"stargazers_count":28,"open_issues_count":3,"forks_count":24,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-10T01:35:40.120Z","etag":null,"topics":["dart","figma"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/figma","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arnemolland.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-23T20:13:14.000Z","updated_at":"2026-02-09T22:18:52.000Z","dependencies_parsed_at":"2024-04-27T12:20:42.701Z","dependency_job_id":"40cc8da9-c6d3-4b05-9dcd-86b3b9be612c","html_url":"https://github.com/arnemolland/figma","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/arnemolland/figma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnemolland%2Ffigma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnemolland%2Ffigma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnemolland%2Ffigma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnemolland%2Ffigma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arnemolland","download_url":"https://codeload.github.com/arnemolland/figma/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnemolland%2Ffigma/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","figma"],"created_at":"2025-10-23T08:05:37.015Z","updated_at":"2026-02-21T02:40:04.657Z","avatar_url":"https://github.com/arnemolland.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# figma\n\n[![Dart CI](https://github.com/arnemolland/figma/actions/workflows/ci.yaml/badge.svg)](https://github.com/arnemolland/figma/actions/workflows/ci.yaml) [![pub](https://img.shields.io/pub/v/figma.svg)](https://pub.dev/packages/figma) ![license](https://img.shields.io/github/license/arnemolland/figma.svg)\n\nA library for interacting with Figma APIs with typed responses and data structures for working with Figma programatically.\n\n## Features\n\n- 🚀 Full Figma API coverage with typed responses\n- 🔒 Support for both API token and OAuth authentication\n- 🔄 Support for variables (both local and published)\n- 🛠️ Comprehensive component and style handling\n- 📱 Export capabilities including PDF format\n- 🧩 Support for component sets and variants\n\n## Installation\n\nAdd the package to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  figma: ^7.3.4\n```\n\nOr install it using the Dart package manager:\n\n```bash\ndart pub add figma\n```\n\n## Getting Started\n\n### Authentication\n\nTo use the Figma API, you'll need an access token. You can obtain one in two ways:\n\n1. **Personal Access Token**: Generate from your Figma account settings\n2. **OAuth Token**: Implement OAuth flow in your application\n\n### Basic Usage\n\n```dart\nimport 'package:figma/figma.dart';\n\nvoid main() async {\n  // Initialize the client with your access token\n  final figma = FigmaClient('your_access_token');\n  \n  // Get a Figma file\n  final file = await figma.getFile('file_key');\n  \n  // Access file data\n  print(file.name);\n  print(file.lastModified);\n}\n```\n\n## Working with Files\n\n### Retrieving File Information\n\n```dart\n// Get file with components\nfinal fileWithComponents = await figma.getFileWithNodes(\n  'file_key',\n  ['node_id_1', 'node_id_2']\n);\n\n// Get file styles\nfinal styles = await figma.getFileStyles('file_key');\n\n// Get component sets\nfinal components = await figma.getFileComponentSets('file_key');\n```\n\n### Working with Images\n\n```dart\n// Export images\nfinal images = await figma.getImage(\n  'file_key',\n  ['node_id'],\n  format: 'png',\n  scale: 2\n);\n\n// Get image fills\nfinal imageFills = await figma.getImageFills(['image_ref_1', 'image_ref_2']);\n```\n\n## Advanced Features\n\n### Variables Support\n\n```dart\n// Get local variables\nfinal localVars = await figma.getLocalVariables('file_key');\n\n// Get published variables\nfinal publishedVars = await figma.getPublishedVariables('file_key');\n```\n\n### Component Management\n\n```dart\n// Get team components\nfinal teamComponents = await figma.getTeamComponents('team_id');\n\n// Get component info\nfinal componentInfo = await figma.getComponent('component_id');\n```\n\n### Comments and Collaboration\n\n```dart\n// Post a comment\nawait figma.postComment(\n  'file_key',\n  'This is a comment',\n  clientMetadata: {'key': 'value'}\n);\n\n// Get file comments\nfinal comments = await figma.getComments('file_key');\n```\n\n## Best Practices\n\n1. **Error Handling**: The library throws `FigmaException` for API errors. Always implement proper error handling:\n   ```dart\n   try {\n     final file = await figma.getFile('file_key');\n   } on FigmaException catch (e) {\n     print('Figma API error: ${e.message}');\n   }\n   ```\n\n2. **Resource Management**: When working with large files, request only the nodes you need:\n   ```dart\n   // Instead of getting the entire file\n   final specificNodes = await figma.getFileNodes(\n     'file_key',\n     ['specific_node_id']\n   );\n   ```\n\n3. **Rate Limiting**: Implement appropriate rate limiting in your application to avoid hitting Figma's API limits.\n\n## Automation Examples\n\n### Export All Frame Images\n\n```dart\nFuture\u003cvoid\u003e exportAllFrames(String fileKey) async {\n  final figma = FigmaClient('your_token');\n  final file = await figma.getFile(fileKey);\n  \n  final frameIds = file.document.children\n      .whereType\u003cFrame\u003e()\n      .map((frame) =\u003e frame.id)\n      .toList();\n      \n  final images = await figma.getImage(\n    fileKey,\n    frameIds,\n    format: 'png'\n  );\n}\n```\n\n## TypeScript/JavaScript Integration\n\nWhen using this library in Flutter web projects that interact with JavaScript/TypeScript codebases:\n\n```dart\n// Dart\nfinal jsonData = await figma.getFile('file_key');\n// Convert to JSON string for JS interop\nfinal jsonString = jsonEncode(jsonData);\n```\n\n```typescript\n// TypeScript\ninterface FigmaFile {\n  // Your TypeScript type definitions\n}\n\nconst figmaData: FigmaFile = JSON.parse(jsonString);\n```\n\n## Resources\n\n- [Figma API Documentation](https://www.figma.com/developers/api)\n- [Package Repository](https://github.com/arnemolland/figma)\n- [Issue Tracker](https://github.com/arnemolland/figma/issues)\n- [Pub.dev Package](https://pub.dev/packages/figma)\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines and submit pull requests to our GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnemolland%2Ffigma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnemolland%2Ffigma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnemolland%2Ffigma/lists"}