For most API packages I use the API key is set and forget. So once I have set it in my profile the package picks it up from the environment automatically.
Since this package has no default value for api_key I think it means I need to do something like api_key = Sys.getenv("SILO_API_KEY") for every function call, which seems a bit verbose. I also keep forgetting it because my expectations are so heavily shaped by other packages.
Probably the most common example is GITHUB_PAT which is picked up by a few different packages e.g. {remotes}, {pak} et. al. Imagine if we had to do install_github("user/package", api_key = Sys.getenv("GITHUB_PAT")) to install from GitHub! But there are also other precedents I use that call the Mapbox API like {rdeck} and {mapdeck}.
From the looks of things changes to support this would be minimal, and perhaps mostly in documentation of the standard environment variables that are checked. Although, I can see that since it depends on which_api in some cases, things get a little messier. It is possible to have a param default based on the value of another, as I am sure you are aware.
For most API packages I use the API key is set and forget. So once I have set it in my profile the package picks it up from the environment automatically.
Since this package has no default value for
api_key
I think it means I need to do something likeapi_key = Sys.getenv("SILO_API_KEY")
for every function call, which seems a bit verbose. I also keep forgetting it because my expectations are so heavily shaped by other packages.Probably the most common example is
GITHUB_PAT
which is picked up by a few different packages e.g.{remotes}
,{pak}
et. al. Imagine if we had to doinstall_github("user/package", api_key = Sys.getenv("GITHUB_PAT"))
to install from GitHub! But there are also other precedents I use that call the Mapbox API like{rdeck}
and{mapdeck}
.From the looks of things changes to support this would be minimal, and perhaps mostly in documentation of the standard environment variables that are checked. Although, I can see that since it depends on
which_api
in some cases, things get a little messier. It is possible to have a param default based on the value of another, as I am sure you are aware.