Integrations / Figma
Figma
Design files: read files and nodes, browse projects, read and post comments.
6 actions
API key
5 read1 write
Calls api.figma.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "figma" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get filereadfigma.get_fileGet a Figma file's name, version, last-modified time and document tree. Use depth to keep it small (depth 1 returns only pages).
| Input | Type | Description | |
|---|---|---|---|
file_key | string | Required | File key from the Figma URL |
ids | array of string | Optional | Only return these node ids (e.g. 1:2) and their children |
depth | integer | Optional | How deep to traverse the tree; 1 returns only pages |
await setu.execute({
userId: "user_1",
action: "figma.get_file",
input: {
"file_key": "<file_key>"
},
});Get file nodesreadfigma.get_file_nodesGet specific nodes (frames, components) from a Figma file by node id, with their subtrees.
| Input | Type | Description | |
|---|---|---|---|
file_key | string | Required | File key from the Figma URL |
ids | array of string | Required | Node ids such as 1:2 |
depth | integer | Optional | Traversal depth below each node |
await setu.execute({
userId: "user_1",
action: "figma.get_file_nodes",
input: {
"file_key": "<file_key>",
"ids": []
},
});List commentsreadfigma.list_commentsList the comments on a Figma file: author, message, time and whether resolved.
| Input | Type | Description | |
|---|---|---|---|
file_key | string | Required | File key |
as_md | boolean | Optional | Return comment text as markdown |
await setu.execute({
userId: "user_1",
action: "figma.list_comments",
input: {
"file_key": "<file_key>"
},
});List project filesreadfigma.list_project_filesList the files in a Figma project: key, name and last-modified time.
| Input | Type | Description | |
|---|---|---|---|
project_id | string | Required | Project id |
await setu.execute({
userId: "user_1",
action: "figma.list_project_files",
input: {
"project_id": "<project_id>"
},
});List team projectsreadfigma.list_team_projectsList the projects in a Figma team. The team id is in the team's URL in the Figma file browser.
| Input | Type | Description | |
|---|---|---|---|
team_id | string | Required | Team id from the team page URL |
await setu.execute({
userId: "user_1",
action: "figma.list_team_projects",
input: {
"team_id": "<team_id>"
},
});Post commentwritefigma.post_commentPost a comment on a Figma file, optionally as a reply to a root comment or pinned at a position.
| Input | Type | Description | |
|---|---|---|---|
file_key | string | Required | File key |
message | string | Required | Comment text |
comment_id | string | Optional | Root comment id to reply to |
client_meta | object | Optional | Where to pin it, e.g. {"x":10,"y":20} |
await setu.execute({
userId: "user_1",
action: "figma.post_comment",
input: {
"file_key": "<file_key>",
"message": "<message>"
},
});