Retrieval of an API subscription key from the environment.
Source:R/get_subscription_key.R
get_subscription_key.Rd
The DTM API subscription key is returned, provided that it is available in
the R session as an environment variable. Users will usually need to set
the DTM_SUBSCRIPTION_KEY environment variable through a .Renviron file (or
other means) or by calling set_subscription_key()
.
Details
On the other hand, if the TESTTHAT environment variable is true, indicating that unit tests are being run by the package maintainers, then the subscription key is returned through different means.
Examples
if (FALSE) { # \dontrun{
# Generally, calling set_subscription_key() without the key as an argument is best,
# as the user can then be prompted to input the key without typing it directly
# into the console, making it more secure and less likely to exposed.
set_subscription_key()
} # }