The wearable
package allows users to interact with activity tracker data in R using device API.
Currently this package allows for read/write functionality for interacting with personal Fitbit data.
wearable isn't available from CRAN yet, but you can get it from github with:
# install.packages("devtools")
devtools::install_github("tracker-neRds/wearable")
To get your own token (API key), you have to register your own application in here. For your reference, we share our setting:
After registration, you can get your own FITBIT_KEY
and FITBIT_SECRET
(referred to as OAuth 2.0 Client ID and Client Secret in the next figure).
If you set the following variables as a global variable, this package will use these values for API key.
# As a global variable
FITBIT_KEY <- "<your-fitbit-key>"
FITBIT_SECRET <- "<your-firbit-secret>"
# If you want, Default: "http://localhost:1410/"
# FITBIT_CALLBACK <- "<your-fitbit-callback>"
Or, you can set these values as a environment variable
Sys.setenv(FITBIT_KEY = "<your-fitbit-key>", FITBIT_SECRET = "<your-firbit-secret>")
-->