Set or get an access token or API key to/from environment variables.
Source:R/set_access_token.R
set_access_token.Rd
Based on the mapboxapi::mb_access_token()
function from the {mapboxapi}
package by Kyle Walker.
Usage
set_access_token(
token,
overwrite = FALSE,
install = FALSE,
type = NULL,
quiet = FALSE,
call = caller_env()
)
get_access_token(token = NULL, type = NULL, call = caller_env())
Arguments
- token
An access token or API key; required for
set_access_token()
. If token is not provided; type is required forget_access_token()
. Length 1 character vector or list. If named, the name of the token is used in place of type.- overwrite
If
TRUE
, overwrite any existing token in.Renviron
using the same environment variable name. Defaults toFALSE
.- install
If
TRUE
, this function adds your token to your.Renviron
for use in future sessions. Defaults toFALSE
.- type
Default name used for environment variable where the token is saved.
- quiet
If
TRUE
, suppress messages when setting token by locally setting thecli.default_handler
option tosuppressMessages()
. Defaults toFALSE
.- call
The execution environment of a currently running function, e.g.
caller_env()
. The function will be mentioned in error messages as the source of the error. See thecall
argument ofabort()
for more information.