I have created a plugin and I want to update/add environment variables through the plugin
I have tried to parse the netlify.toml file and add then update it with our variables to [context.production.environment]
but after the deployment process succeeded the new environment variables not exists and netlify.toml file not get updated
is this the right way to update/add environment variables through the plugin and what are the available other option to update/add env variables?
to see how plugins can react with environment variables in the TOML file.
Environment variables defined in the TOML file aren’t usable in runtime. They can be accessed only during the built. This is what the above plugin attempts to solve.
You can use the API, specifically:
The variables will be listed at build_settings.env
What if want to use the api from the plugin. a token s required
But I only have two options, Personal access token or oAuth2
is there any way I can use the api without personal access token and don’t have to create application and require user permission with oAuth
Okay. I have tried the plugin and I found that I can update/add env variables for platforms with prefix like REACT_APP_ , but normal env variables without prefix are not accessible and I cant read it from my repository