R/set_key.R

Defines functions set_key

Documented in set_key

#' Set API key
#'
#' @description This function is a simple wrapper of the `Sys.setenv` base
#' function. It sets the value of the environmental variable `EUROPEANA_KEY`.
#' Alternatively, use .Renviron to set the key. Get and API key in the
#' following link https://pro.europeana.eu/page/get-api.
#'
#' @param api_key string with the API key
#'
#' @returns No return value, called for setting the environmental variable
#' `EUROPEANA_KEY`.
#'
#' @seealso \code{\link{setkey}}
#' @export
set_key <- function(api_key) {
  stopifnot(is.character(api_key))
  Sys.setenv(EUROPEANA_KEY = api_key)
}

Try the europeanaR package in your browser

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

europeanaR documentation built on May 17, 2022, 5:09 p.m.