Feature request: import environment variables

I manage a Netlify dashboard with many websites that share similar environment variables (in node.js).

It would be pretty neat to be able to import environment variables from an existing project when creating a new one.

You can already do this via netlify.toml - configure the variables there and use the same toml (or same repo) on multiple sites.

If that doesn’t seem like a good solution to your use case, could you give additional details as to why not, and as to how you’d prefer to import them if not from a config file?

No, this doesn’t work for me, because while there are many common vars, a few of them are different per each website. I can’t have multiple netlify.toml files in the subfolders of my repo, afaik.

Then, what about privacy? Wouldn’t these vars become public to anyone with access to the repo, if they are moved to the Netlify config file?

Thanks for those details! I agree there is no straightforward method to handle your use case. If you wanted to automate site setup, you could explore using our API to create sites directly, is probably the best solution we’ll have in the near future:

1 Like