R/api_key.R

Defines functions api_key

#' Get the Firebase API key
#'
#' Gets your Firebase API key from the env var `FIREBASE_API_KEY`. Make sure
#' you have defined this variable in your .Renviron file.
#'
#' @return String
#' @examples
#' \dontrun{
#'   api_key()
#' }
#' @keywords internal
#' @noRd
api_key <- function() {
  key <- Sys.getenv("FIREBASE_API_KEY")
  if (key == "") {
    stop(
      "Firebase API key not found.",
      " Please define `FIREBASE_API_KEY` in your .Renviron file.",
      " Restart your R session afterwards.",
      call. = FALSE
    )
  }
  key
}

Try the firebase.auth.rest package in your browser

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

firebase.auth.rest documentation built on April 3, 2025, 6:19 p.m.