Barebones React demo of Figma's Code Connect.
npm i
to install dependenciesnpm run app:dev
will run server at localhost:8000 which renders contents of App.tsx.
- Duplicate this file and get the file key from the duplicated file url.
- In this repository, find all
YNd9Z3MuX8r9PrjNDmXboP
and replace with the new file's file key. npx figma connect publish --token <your-token>
to publish the existing docs
- Create a
.env
file in the root of the project (file is git ignored) - Put the contents
FIGMA_ACCESS_TOKEN=fig_yourtoken
in the file and save - You'll no longer need to append
--token <your-token>
to the connect commands. - The one caveat is that currently you'll always need to run figma connect from the root.
- Running figma connect from a sub directory (like
./src/ui
) will not find the token. - This is a bug and should be fixed soon.
- Running figma connect from a sub directory (like