Skip to content

Commit

Permalink
Add instructions for the Figma API token
Browse files Browse the repository at this point in the history
  • Loading branch information
danielguillan committed Oct 3, 2024
1 parent 081f6ee commit d0b752b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ This repository is evolving as our documentation needs change. See our [contribu
4. `yarn` to install dependencies
5. `yarn start` to start the dev server

### Figma API token

To get images downloaded from the Figma API, you'll need to create a `.env` file in the root of the project and add your Figma API token. You can create a new token [here](https://www.figma.com/developers/api#access-tokens).

```sh
`FIGMA_API_TOKEN=your-token-here`
```

## Deployment

Expand All @@ -29,11 +36,22 @@ We deploy this site using [GitHub Pages](https://pages.github.com/). Every push
## FAQ

### How do I add documentation for a new component or edit existing component documentation?
- Our [component documentation files are found here](https://github.com/primer/design/tree/main/content/components), and guidelines for adding content can be found under the [Documenting components](https://primer.style/guides/contribute/documentation#documenting-components) section of the [Contributing guidelines]((https://primer.style/guides/contribute/documentation)).

- Our [component documentation files are found here](https://github.com/primer/design/tree/main/content/components), and guidelines for adding content can be found under the [Documenting components](https://primer.style/guides/contribute/documentation#documenting-components) section of the [Contributing guidelines](<(https://primer.style/guides/contribute/documentation)>).
- For a more detailed walk-through, check out this [tutorial video](https://www.loom.com/share/ac56f610076f41878d0351b4a1c44a6b?sid=1bd5a46d-a7ea-4e0d-bb08-ed9e8c8bfe12).

### I need help getting started.

- Check out our [getting started guides](https://primer.style/guides) or ping us in [Slack](https://github.slack.com/archives/CSGAVNZ19) (GitHub staff only)

### I noticed a bug in the documentation!

- Feel free to open a pull request or issue directly in this repository, or ping us in [Slack](https://github.slack.com/archives/CSGAVNZ19) (GitHub staff only)

```
```

```
```
6 changes: 3 additions & 3 deletions scripts/buildFigmaImages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const findMatches = async (regexPattern, files) => {
const run = async () => {
// check for Figma API token before proceeding
if (!process.env.FIGMA_API_TOKEN) {
console.warn(
'⚠️ Skipping getting Figma images. Please provide a Figma API token as the FIGMA_API_TOKEN environment variable.',
)
console.warn('⚠️ No Figma API token provided. Skipping image download from Figma.')
console.log('To get a Figma API token, visit https://www.figma.com/developers/api#access-tokens')
console.log('Then, add the token to an .env file in the root of the project with: FIGMA_API_TOKEN=your-token-here')
return
}

Expand Down

0 comments on commit d0b752b

Please sign in to comment.