Skip to contents

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().

Usage

get_subscription_key()

Value

A string representing a given subscription key for the DTM API.

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()
} # }