R/get_api_key.R

Defines functions get_api_key

Documented in get_api_key

#' Gets the value of the WTW_API_KEY environment variable
#'
#' @return The value of the `WTW_API_KEY` environment variable.
#' @export
#'
#' @examples
#' \dontrun{get_api_key()}
get_api_key <- function() {
  key <- Sys.getenv("WTW_API_KEY")
  if (identical(key, "")) {
    stop("No API key found, please set the WTW_API_KEY environment variable.")
  }
  key
}

Try the whatthreewords package in your browser

Any scripts or data that you put into this service are public.

whatthreewords documentation built on Oct. 2, 2023, 5:09 p.m.