Setu Recipes: reusable digital workers across every app.Browse templates

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

TypeScript
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).
InputTypeDescription
file_keystringRequiredFile key from the Figma URL
idsarray of stringOptionalOnly return these node ids (e.g. 1:2) and their children
depthintegerOptionalHow deep to traverse the tree; 1 returns only pages
TypeScript
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.
InputTypeDescription
file_keystringRequiredFile key from the Figma URL
idsarray of stringRequiredNode ids such as 1:2
depthintegerOptionalTraversal depth below each node
TypeScript
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.
InputTypeDescription
file_keystringRequiredFile key
as_mdbooleanOptionalReturn comment text as markdown
TypeScript
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.
InputTypeDescription
project_idstringRequiredProject id
TypeScript
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.
InputTypeDescription
team_idstringRequiredTeam id from the team page URL
TypeScript
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.
InputTypeDescription
file_keystringRequiredFile key
messagestringRequiredComment text
comment_idstringOptionalRoot comment id to reply to
client_metaobjectOptionalWhere to pin it, e.g. {"x":10,"y":20}
TypeScript
await setu.execute({
  userId: "user_1",
  action: "figma.post_comment",
  input: {
    "file_key": "<file_key>",
    "message": "<message>"
  },
});