R/get_bws_access_token.R

Defines functions get_bws_access_token

Documented in get_bws_access_token

#' Retrieve BWS Access Token from Environment
#'
#' Retrieves the `BWS_ACCESS_TOKEN` from environment variables. This token is
#' used to authenticate with the Bitwarden Secrets Manager API.
#'
#' @return A character string containing the BWS access token.
get_bws_access_token <- function() {
  bws_access_token <- Sys.getenv("BWS_ACCESS_TOKEN")
  if (bws_access_token == "") {
    stop("No BWS_ACCESS_TOKEN provided or set as environment variable.")
  }
  return(bws_access_token)
}

Try the vvbitwarden package in your browser

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

vvbitwarden documentation built on April 12, 2025, 1:15 a.m.