R/getToken.R

Defines functions getToken

Documented in getToken

#' Set personal access token
#' 
#' A function that asks the user to set their token
#' @name getToken
#' @keywords getToken
#' @export
#' @import dplyr
#' @examples
#' auth_token <- getToken()
getToken <- function() {
  
  print("Enter the personal access token associated with your YNAB account:")
  
  token <- readline(prompt = "Enter token: ") %>% as.character()
  
  if (!is.character(token)) {
    stop("Input an integer")
  }
  
  return(token)
}
mathewroy/ynabr documentation built on Jan. 28, 2023, 2:40 a.m.