Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 1.88 KB

File metadata and controls

70 lines (47 loc) · 1.88 KB

Setup & Usage

This guide walks through installing dependencies, configuring environment variables, and running the exporter.

Prerequisites

  • Node.js ≥ 22 (matches the engines field in package.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 prepare script. Ensure your network allows that download.

1. Install dependencies

git clone https://github.com/<org>/figma-export.git
cd figma-export
npm install

2. Configure environment variables

Create 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_PASSWORD

Refer to the Environment Variables doc for the full matrix of options, defaults, and tuning knobs.

3. Build (optional in dev)

For most workflows you compile once and run the generated JS:

npm run build

During development you can run TypeScript directly:

npm run dev

4. Run the exporter

After a build:

npm run export
# equivalent to:
# npm run build && node dist/index.js

This does the following:

  1. Lists teams/projects via the Figma API.
  2. Lets you pick a project in the terminal UI.
  3. Prompts for files in that project.
  4. Launches Playwright to download .fig files into EXPORT_OUTPUT_DIR.

Troubleshooting

  • Playwright browser doesn’t open: set LAUNCH_HEADLESS=false to observe interactions.
  • Timeouts: adjust the EXPORT_*_TIMEOUT_MS values in .env.
  • Auth issues: re-run with LAUNCH_HEADLESS=false to verify Figma login, or refresh your cookie/token.

Need more details? Check the inline comments in .env.example or open an issue.***