-
Notifications
You must be signed in to change notification settings - Fork 12
Complete beginner guide
This guide will walk you through how to set up all the prerequisites and how to configure and use figma-export itself.
Note
This iteration of the guide will focus on macOS, but I plan on writing a Windows specific guide as well.
The required prerequisites are installing Node.js, npm, and Git.
We'll install Node.js and npm using nvm
, a Node.js version manager.
- Open Terminal.app
- Run the following command to install
nvm
:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
- Once the installation finishes, run the following command to install Node.js and npm:
nvm install 20
We'll install Git through XCode's command line tools.
- Open Terminal.app
- Run the following command to initialize the installation:
xcode-select --install
- A macOS prompt will appear. Click Install.
- Once the installation finishes, you can click Done
Go to https://www.figma.com/developers/api#access-tokens and follow the instructions on how to generate an access token for your Figma account. Your access token must have access to the file contents scope.
Keep this access token somewhere safe because we'll need it later.
- Open Terminal.app
- Run the following command to download figma-export to your home folder:
git clone https://github.com/alexchantastic/figma-export.git
- Run the following command to navigate to where figma-export was downloaded in the prior step:
cd figma-export
- Run the following command to install figma-export's dependencies:
npm install
- Open Terminal.app
- Run the following command to create a
.env
file and edit it with TextEdit.app:
touch .env; open -e .env
-
TextEdit.app should launch with
.env
ready to edit - Paste the following into the
.env
file:
FIGMA_EMAIL="YOUR_FIGMA_EMAIL"
FIGMA_PASSWORD="YOUR_FIGMA_PASSWORD"
FIGMA_ACCESS_TOKEN="YOUR_FIGMA_ACCESS_TOKEN"
DOWNLOAD_PATH="YOUR_ABSOLUTE_DOWNLOAD_PATH"
WAIT_TIMEOUT=10000
Note
If you are using SSO to log into Figma and thus do not have a password, please reference the wiki guide on how to set a password. If you are stuck on SSO for whatever reason, you will need to use the FIGMA_AUTH_COOKIE
method which will not be covered in this guide.
- Replace
YOUR_FIGMA_EMAIL
with the email you use to log into Figma - Replace
YOUR_FIGMA_PASSWORD
with the password you use to log into Figma - Replace
YOUR_FIGMA_ACCESS_TOKEN
with your Figma access token - Replace
YOUR_ABSOLUTE_DOWNLOAD_PATH
with the absolute path to where you want your downloaded files to be saved to - Your
.env
file should now look something like this:
FIGMA_EMAIL="[email protected]"
FIGMA_PASSWORD="hunter2"
FIGMA_ACCESS_TOKEN="figd_abcdefghijklmnopqrstuvwxyz"
DOWNLOAD_PATH="/Users/anonymous/Downloads"
WAIT_TIMEOUT=10000
- Save your
.env
file
figma-export supports gathering Figma files by team(s) or by project(s).
Note
If you are looking to download your drafts, please refer to this wiki page.
To find your Figma team ID, navigate to your Figma home, right click your team in the left sidebar, and then click Copy link. The last segment of the URL that you copied will contain your team ID: https://www.figma.com/files/team/1234567890
.
- Open Terminal.app
- Run the following command to generate a
files.json
file of the Figma files to download (replaceYOUR_TEAM_ID
with your team's ID):
npm run get-team-files YOUR_TEAM_ID
Tip
If you would like to download from multiple teams, you can use a space separated list of team IDs (e.g., npm run get-team-files 1234 5678 9012
).
To find a project ID, navigate to your team's home, right click the project, and then click Copy link. The last segment of the URL that you copied will contain the project ID: https://www.figma.com/files/project/1234567890
:
- Open Terminal.app
- Run the following command to generate a
files.json
file of the Figma files to download (replaceYOUR_PROJECTID
with your project's ID):
npm run get-project-files YOUR_PROJECT_ID
Tip
If you would like to download from multiple projects, you can use a space separated list of project IDs (e.g., npm run get-project-files 1234 5678 9012
).
- Open Terminal.app
- Run the following command to start downloading the Figma files listed in
files.json
:
npm run start
Important
Downloads may take a while depending on how large your files are, how many files are being downloaded, and your internet connection speed.
The status of the downloads will be shown in Terminal.app. Your Figma files will be download to the folder path that you specified in the .env
file.
If you run into an issue, please refer to the known issues before opening a GitHub issue.