Repository navigation
feat(figma): add Figma API module - #151
Open
seanspeaks wants to merge 2 commits into
Open
seanspeaks wants to merge 2 commits into
seanspeaks wants to merge 2 commits into
Conversation
Add @friggframework/api-module-figma under packages/v1-ready/figma with OAuth2 client, curated OpenAPI subset, capability manifest, Fenestra draft, HubSpot-style webhooks extension, and offline jest/spec-sync coverage. Co-authored-by: Sean Matthews <sean.matthews@lefthook.co>
Regenerate figma.openapi.yaml as a path-filtered extract of the vendor OpenAPI (params, request/response schemas, per-op scopes, server URL). Add project_metadata:read, forward getFolderFiles branch_data, and sync capability field names to official schemas. Co-authored-by: Sean Matthews <sean.matthews@lefthook.co>
seanspeaks
marked this pull request as ready for review
October 22, 2026 00:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
@friggframework/api-module-figmaatpackages/v1-ready/figma/— a Frigg v2 API module for the Figma REST API.No prior package existed under
packages/(includingneeds-updating); this is a greenfield module shaped likepackages/v1-ready/fathom/, with webhooks modeled onpackages/v1-ready/hubspot/extensions/webhooks/.What the API is / sources
Figma’s public REST API (
https://api.figma.com) for files, folders/projects, comments, users, and Webhooks V2.figma.openapi.yamlis a path-filtered extract of the vendor OpenAPI above: server URL, per-operation security/scopes, parameters, and request/response schemas are taken verbatim for the curated operations (webhook deliverycallbacksomitted — not client operations). OneoperationId↔ oneApimethod.Auth method
OAuth 2 authorization code (recommended by Figma for multi-user apps):
https://www.figma.com/oauthPOST https://api.figma.com/v1/oauth/tokenwith HTTP Basic (client_id:client_secret)POST https://api.figma.com/v1/oauth/refreshwith Basic auth (body:refresh_tokenonly)GET /v1/me→externalId = user.idFIGMA_CLIENT_ID,FIGMA_CLIENT_SECRET, optionalFIGMA_SCOPE,REDIRECT_URIDefault scopes (from vendor operation security requirements):
current_user:read,file_content:read,file_metadata:read,file_comments:read,file_comments:write,projects:read,project_metadata:read,folders:read,folder_metadata:read,webhooks:read,webhooks:write.Access note: Public OAuth apps require Figma review before end-user authorization. Private apps are limited to the associated team/org.
Endpoints covered
getMeGET /v1/megetFile/getFileMetaGET /v1/files/{key}·/metagetComments/postComment/deleteCommentgetTeamProjects/getProjectFiles/getProjectMetagetTeamFolders/getFolderFiles/getFolderMetagetWebhooks/postWebhook/getWebhook/putWebhook/deleteWebhook/getTeamWebhooks/getWebhookRequestsEndpoints skipped (same scope; not wrong — simply out of curated set)
Images/renders, file versions, components/styles/sets, variables, dev resources, activity/developer logs, library analytics, AI usage, payments, oEmbed, nested
getFolderFolders, comment reactions. No comment update exists in the public REST API.Vendor-spec follow-up (this push)
Diffed every curated operation against https://raw.githubusercontent.com/figma/rest-api-spec/main/openapi/openapi.yaml (paths, methods, params, request/response fields, auth/scopes, server URL). 0 structural mismatches after regen.
What changed:
figma.openapi.yamlfrom the vendor document (full component schemas/$refs for curated paths; removed invented globalsecurity: [OAuth2]; restored authentic request/response bodies).project_metadata:readrequired byGET /v1/projects/{project_id}/meta.getFolderFiles(folderId, query)now forwards officialbranch_dataquery param (was missing).GetFileResponsecamelCase; project/folder meta snake_case;Comment/WebhookV2complete fields). Removed incorrect filekeyfield (not onGetFileResponse).putWebhookquirk:team_idis required but omitted frompropertiesin the vendor schema (preserved as published).branch_data, putWebhook quirk).Capability manifest
figma.capabilities.json— schemacapability-manifest/v0.1withmodule,package,version,auth, andobjects.*.fields[](tagged) foruser,file,project,folder,comment,webhook. Every declared method maps to a realApimethod.Fenestra
figma.fenestra.yaml— draft for Figma’s Plugin/Widget UI platform. Sourced fromclaude/fenestra-spec-draft-Q367texample; validates withfenestra.js validate.Webhooks extension
extensions/webhooks/— HubSpot-style Tier 3 receiver verifyingbody.passcodevsFIGMA_WEBHOOK_PASSCODE.Proof
npm test— pass (28 tests)Capture:
/opt/cursor/artifacts/figma-npm-test.txtfrigg validate --module— passFrom frigg
cursor/frigg-validate-module-1721(PR friggframework/frigg#702):frigg auth test .— pending credentialsNo sandbox OAuth client / tokens in this environment.
Open questions
Closed by the vendor OpenAPI
project_metadata:readis required forgetProjectMeta(now included).getFolderFilesquery — answered: official param isbranch_data(boolean, default false); client now forwards it.FILE_UPDATE,FILE_VERSION_UPDATE,FILE_DELETE,LIBRARY_PUBLISH,FILE_COMMENT,DEV_MODE_STATUS_UPDATE(+PINGin enum but delivery-only).event_type,team_id,endpoint,passcode;team_idabsent frompropertiesin the published schema.Still open
webhook_id+passcodebut not the OAuth user id. Preferred pattern: per-tenant passcode, path segment, orwebhook_id → entity.externalIdside table?setAuthParamspath for org plan tokens, or keep OAuth-only?capability-manifest/v0.1against the canonical frigg schema whenpackages/core/integrations/definitions/capabilities/lands.Credit
@friggframework/api-module-fathom@friggframework/api-module-hubspotextensions/webhooks/claude/fenestra-spec-draft-Q367texample