code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

Possible to use Figma Node URL from env file

Open rohanchkrabrty opened this issue 3 months ago • 4 comments

I wanted to set the figma node url in an .env file and use it for Code Connect, but couldn't find any way

Is there any way to do this?

rohanchkrabrty avatar Sep 23 '25 06:09 rohanchkrabrty

Hey @rohanchkrabrty! We don't support setting the figma node url in an .env file. What's your use case out of interest?

Depending on what you're trying to achieve we support some options in figma.config.json which might help:

  • documentUrlSubstitutions: dynamically swap in different URLs to publish to
  • interactiveSetupFigmaFileUrl: only supported by the interactive setup, but allows setting a file URL to always use

slees-figma avatar Sep 23 '25 09:09 slees-figma

Hey @slees-figma, thanks for the reply. I’m working with a design system where the code library is public and open source, but the Figma design files are private. I’d prefer not to expose the Figma URL in the repo.

Would it be possible to support reading from .env in either figma.config.json or component.figma.tsx

rohanchkrabrty avatar Sep 23 '25 11:09 rohanchkrabrty

On a related note, is there a way to hide or suppress the output logs from figma connect publish? The logs currently expose the source URL, which isn’t ideal given the situation I described above.

Image

rohanchkrabrty avatar Sep 23 '25 11:09 rohanchkrabrty

Thanks @rohanchkrabrty! We don't support either of these today but we'll track this for future discussion. I don't think we have any great workarounds here - I think the closest you'd get is manually inputting your file URL into figma.config.json documentUrlSubstitutions (or writing a script to do it)

slees-figma avatar Sep 25 '25 10:09 slees-figma