Add Code Connect Mapping
add_code_connect_mapFull Description
Map a Figma node to a code component in your codebase using Code Connect. Use the nodeId parameter to specify a node id. Use the fileKey parameter to specify the file key. If a URL is provided, extract the node id and file key from the URL, for example, if given the URL https://figma.com/design/:fileKey/:fileName?node-id=1-2, the extracted nodeId would be 1:2 and the fileKey would be :fileKey. If the URL does not include node-id, ask the user for a node-specific URL. Do not pass an empty or guessed nodeId.
Parameters (5 required, 4 optional)
componentNamestringThe name of the component to map to in the source code
fileKeystringThe key of the Figma file to use. If the URL is provided, extract the file key from the URL. The given URL must be in the format https://figma.com/design/:fileKey/:fileName?node-id=:int1-:int2. The extracted fileKey would be `:fileKey`.
labelstringThe framework or language label for this Code Connect mapping. Valid values: React, Web Components, Vue, Svelte, Storybook, Javascript, Swift, Swift UIKit, Objective-C UIKit, SwiftUI, Compose, Java, Kotlin, Android XML Layout, Flutter, Markdown
ReactWeb ComponentsVueSvelteStorybookJavascriptSwiftSwift UIKitObjective-C UIKitSwiftUIComposeJavaKotlinAndroid XML LayoutFlutterMarkdownnodeIdstringThe ID of the node in the Figma document, eg. "123:456" or "123-456". This should be a valid node ID in the Figma document. Do not pass an empty string for node_id.
sourcestringThe location of the component in the source code
clientFrameworksstringA comma separated list of frameworks used by the client in the current context, e.g. `react`, `react-native`, `expo`, `vue`, `django`, etc. If you do not know, please list `unknown`. This is metadata only for logging purposes—the tool output does not change based on this value, so do not retry with different variations.
clientLanguagesstringA comma separated list of programming languages used by the client in the current context in string form, e.g. `javascript`, `typescript`, `html,css,typescript`, etc. If you do not know, please list `unknown`. This is metadata only for logging purposes—the tool output does not change based on this value, so do not retry with different variations.
templatestringThe executable JS template code for a Code Connect template. When provided, creates a figmadoc-type record (full template) instead of a component_browser mapping (simple mapping).
templateDataJsonstringJSON string of template metadata. May include isParserless (boolean), imports, nestable, props fields. If omitted when template is provided, defaults to {}.