It would be great to enhance the set_authorization function to look in standard places for an API key, to encourage users to not put API keys in their source file and then accidentally distribute those keys.
For example, I put the following in ~/.Renviron:
CMAP_PAT_USER=xxxx
Then I use
# readRenviron("~/.Renviron") # put the API key in ~/.Renviron as CMAP_PAT_USER=XXXX
set_authorization(cmap_key = Sys.getenv("CMAP_PAT_USER"))
credentials::set_github_pat has other ideas as well.
Or perhaps just suggest this pattern in the documentation?