This guide walks through installing dependencies, configuring environment variables, and running the exporter.
- Node.js ≥ 22 (matches the
enginesfield inpackage.json) - npm (ships with Node)
- A Figma access token and either cookie- or password-based credentials (see Environment Variables)
On the first install, Playwright downloads Chromium automatically via the
preparescript. Ensure your network allows that download.
git clone https://github.com/<org>/figma-export.git
cd figma-export
npm installCreate a .env file in the project root (or export the vars in your shell). At minimum you need:
FIGMA_ACCESS_TOKEN=your-access-token
FIGMA_TEAM_ID=team-id
FIGMA_AUTH_COOKIE=... # or FIGMA_EMAIL / FIGMA_PASSWORDRefer to the Environment Variables doc for the full matrix of options, defaults, and tuning knobs.
For most workflows you compile once and run the generated JS:
npm run buildDuring development you can run TypeScript directly:
npm run devAfter a build:
npm run export
# equivalent to:
# npm run build && node dist/index.jsThis does the following:
- Lists teams/projects via the Figma API.
- Lets you pick a project in the terminal UI.
- Prompts for files in that project.
- Launches Playwright to download
.figfiles intoEXPORT_OUTPUT_DIR.
- Playwright browser doesn’t open: set
LAUNCH_HEADLESS=falseto observe interactions. - Timeouts: adjust the
EXPORT_*_TIMEOUT_MSvalues in.env. - Auth issues: re-run with
LAUNCH_HEADLESS=falseto verify Figma login, or refresh your cookie/token.
Need more details? Check the inline comments in .env.example or open an issue.***