Set the API key associated with a web service provider.
setAPIKey(provider = NULL, key = NULL)Invisibly returns the previous value of the API key.
API keys are stored in package session state and are remembered only for the duration of the current R session.
# Setting a key invisibly returns the previous value (NULL at first)
setAPIKey("exampleProvider", "abcd1234efgh5678")
old <- setAPIKey("exampleProvider", "newkey5678")
old
#> [1] "abcd1234efgh5678"
# Setting a key to NULL removes it
setAPIKey("exampleProvider", NULL)
getAPIKey("exampleProvider")
#> NULL