Access Code Connect output via Figma API
👋 Hi Figma team,
Our team is exploring the use of LLMs to generate more concrete code examples by leveraging Figma Code Connect. Currently, we are passing in the Code Connect config, component interface, and the Figma DOM tree to the LLM. However, we don't have access to the full Figma Code Connect output, which would be extremely useful for more accurate and context-aware code generation.
Is there a way to retrieve the Code Connect output using the Figma API? Accessing this data programmatically would allow us to improve the accuracy and relevance of our AI-generated code snippets.
Any guidance or suggestions on how to obtain this data would be greatly appreciated!
Thanks for your help!
Best regards, Siddharth
HI @siddharthkul, it is not currently possible, but we are exploring ways to expose that
We'd also really love this!
Currently, we don't have any design components for layout, because our designers just use autolayout. We're building a Figma Dev Mode plugin that helps convert autolayout nodes to our internal React Layout components, but in order to do this at scale, we'd like to be able to request the Code Connect snippets from the Figma API.
We would also really love this, have posted this request in figma forum.
https://forum.figma.com/t/code-connect-integration-with-figma-api/88894
"I’m working on a proof-of-concept to generate code using our internal design system components for Figma designs. I’ve successfully linked our design system to a feature design file in Figma. Now, I want to confirm whether the Figma API will return data about these linked design system components. Specifically, I’m interested in whether the API response will reflect the relationship between the feature design elements and the underlying design system components, similar to how the relationship is displayed in the Figma inspect panel. Essentially, I need to know if the API provides enough information to identify which design system components are used within the feature design."
Would love to see this implemented as well 🙏
Currently, we don't have any design components for layout, because our designers just use autolayout. We're building a Figma Dev Mode plugin that helps convert autolayout nodes to our internal React Layout components, but in order to do this at scale, we'd like to be able to request the Code Connect snippets from the Figma API.
That's a great idea! Do you mind sharing a bit more about this? I'm in the same boat and would love to know how you're handling this without the Code Connect output.
+1 here - AI agents would gobble this rich content right up!
+1 for this!