Performs the OAuth 2.0 dance to create a token to use with the Fitbit API.
generate_fitbitr_token(
app_name = "fitbitr",
client_id = Sys.getenv("FITBIT_CLIENT_ID"),
client_secret = Sys.getenv("FITBIT_CLIENT_SECRET"),
callback = Sys.getenv("FITBIT_CALLBACK", "https://localhost:1410/"),
scope = c("activity", "cardio_fitness", "electrocardiogram", "heartrate", "location",
"nutrition", "oxygen_saturation", "profile", "respiratory_rate", "settings", "sleep",
"social", "temperature", "weight"),
cache = TRUE,
use_basic_auth = TRUE,
...
)Returns an OAuth 2.0 token (invisibly) that can be used to authorize requests to the Fitbit API. Also saves the token to .fitbitr_token.
The name of your OAuth app. Default: fitbitr
Your Fitbit client ID
Your Fitbit client secret
Your Fitbit redirect URL
The scopes to enable
Do you want to cache your token? See oauth2.0_token for details
A boolean for whether or not to use basic auth in oauth2.0_token. Defaults to TRUE
additional arguments to be passed to oauth2.0_token
Saves a token as .fitbitr_token which can then be used in the
background to authorize requests