mb_access_token.Rd
See the Mapbox API documentation for more information on access tokens and token scopes.
mb_access_token(token, overwrite = FALSE, install = FALSE)
get_mb_access_token(
token = NULL,
default = c("MAPBOX_PUBLIC_TOKEN", "MAPBOX_SECRET_TOKEN"),
secret_required = FALSE
)
list_tokens(
username,
default = NULL,
limit = NULL,
sortby = "created",
usage = NULL,
access_token = NULL
)
A Mapbox access token; can be public (starting with 'pk') or secret (starting with 'sk') scope, which the function will interpret for you.
Whether or not to overwrite an existing Mapbox access token.
Defaults to FALSE
.
if TRUE
, will install the key in your .Renviron
file for use
in future sessions. Defaults to FALSE
.
If TRUE
, will only include the default token for an account.
If FALSE
, will include all other tokens except for the default. Defaults
to NULL
.
If TRUE
, a secret token is required. If FALSE
, the
default token is provided first and the other token provided second if the
first is unavailable.
The Mapbox username for which you'd like to list access tokens.
The maximum number of tokens to return. Defaults to NULL
.
How to sort the returned tokens; one of "created"
or
"modified"
.
If "pk"
, returns only public tokens; if "sk"
, returns only
secret tokens. Defaults to NULL
, which returns all tokens in the scope of
the supplied access token.
Your Mapbox access token. If left NULL
, will first check
to see if you have a secret token stored in .Renviron, then a public token.
A tibble of information about tokens in your Mapbox account.
if (FALSE) {
my_token <- "..." # The token generated from your Mapbox account
mb_access_token(my_token, install = TRUE)
Sys.getenv("MAPBOX_PUBLIC_TOKEN")
get_mb_access_token()
}
if (FALSE) {
token_list <- list_tokens(
username = "kwalkertcu", # You would use your own username here
limit = 10,
sortby = "modified" #'
)
}