An account in Figma can be accessed using the API and a personalaccess token.
Make your own access token:
Open your Figma account and log in.
From the top-left menu in Figma, select AccountSettings.
Locate the section on personal access tokens.
Select New Token by clicking.
There will be a token created. This will be your last opportunityto copy the token, so be careful to store a copy of it safely.
When you retrieve the personal access token save it as anenvironmental variable (e.g. edit.Renviron by typingusethis::edir_r_environ()).
FIGMA_ACCESS_TOKEN="YOUR_ACCESS_TOKEN_GOES_HERE!!!"After saving your changes restart R session.
Open Figma and navigate to your favorite file. In the URL you can seethe key of the file. To retrieve the File as an R object execute:
library(Rigma)example_file_key <- "sFHgQh9dL6369o5wrZHmdR"get_file(example_file_key)A tree of nodes is used to represent the Figma file. Every file has aDOCUMENT node at the root, and any CANVAS nodes branch out of that node.Various POST and GET methods are provided in this package to interactwith a Figma files and teams.