Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 2.44 KB

File metadata and controls

55 lines (38 loc) · 2.44 KB

Environment Configuration

This project reads all configuration from environment variables (or a .env file loaded via dotenv). The variables are grouped below by purpose. Defaults are applied where noted; everything else must be supplied explicitly.

Required

Variable Description
FIGMA_ACCESS_TOKEN Personal access token with permission to read file metadata.
FIGMA_TEAM_ID Team ID whose projects you want to browse/download.

Authentication options

Exactly one of the following flows must be configured:

Cookie-based

Variable Description
FIGMA_AUTH_COOKIE Value of the __Host-figma.authn cookie from an authenticated browser session.

Credentials-based

Variable Description
FIGMA_EMAIL Figma account email address.
FIGMA_PASSWORD Password for the above account.

If you set FIGMA_EMAIL, you must set FIGMA_PASSWORD (and vice versa). Otherwise the app will refuse to start.

Paths & execution

Variable Default Description
EXPORT_OUTPUT_DIR downloads Directory where .fig files are saved. Relative paths are resolved from the project root.
LAUNCH_HEADLESS true Pass false to watch the Playwright browser run in headed mode (useful for debugging).

Timeout tuning

All timeouts are expressed in milliseconds. The defaults are conservative enough for most environments. Increase them if you hit slow network conditions.

Variable Default Usage
EXPORT_WAIT_TIMEOUT_MS 15000 Delay between each file download.
EXPORT_NAVIGATION_TIMEOUT_MS 120000 Maximum time to wait for Figma design pages to finish loading.
EXPORT_MENU_TIMEOUT_MS 120000 Maximum time to wait for menu elements (File → Save local copy) to become available.
EXPORT_DOWNLOAD_TIMEOUT_MS 6000000 Maximum time to wait for the .fig download event.
EXPORT_DASHBOARD_TIMEOUT_MS 180000 Maximum time to wait for the Figma dashboard while verifying authentication.
EXPORT_PROFILE_TIMEOUT_MS 10000 Maximum time to wait for the profile button to appear after login.

Tips

  • Keep .env out of version control—it contains secrets.
  • When switching from cookie auth to credentials (or back), remove the previous values to avoid accidental misuse.
  • Timeouts can be overriden selectively; anything you omit falls back to the defaults listed above.