### Fetch Figma Components with Code Connect Client Source: https://github.com/figma/code-connect/blob/main/cli/scripts/README.md Use the client.getComponents function to fetch components from a Figma file. Filter the results to select specific components, such as those starting with 'icon'. This is a prerequisite for writing code connect files. ```typescript import { client } from '@figma/code-connect' async function getIcons() { const components = await client.getComponents('https://figma.com/file/ABc123IjkLmnOPq?node-id=41-41') const icons = components.filter(({ name }) => name.startsWith('icon')) // ... write code connect file } ``` -------------------------------- ### Run Import Icons Script with .env Source: https://github.com/figma/code-connect/blob/main/cli/scripts/README.md Execute the import-icons.ts script using npx tsx. Code Connect automatically picks up the access token if it's configured in an .env file. ```bash npx tsx import-icons.ts ``` -------------------------------- ### Run Import Icons Script with Token Source: https://github.com/figma/code-connect/blob/main/cli/scripts/README.md Execute the import-icons.ts script using npx tsx, providing your Figma access token as an environment variable. ```bash FIGMA_ACCESS_TOKEN= npx tsx import-icons.ts ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.