Name: RADAR-REST-fitbit
Owner: RADAR-CNS
Description: null
Created: 2018-02-21 08:42:51.0
Updated: 2018-02-27 17:18:30.0
Pushed: 2018-02-21 12:17:46.0
Homepage: null
Size: 12
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This application is designed to poll the Fitbit web API and post data to a Kafka topic.
This repository is intended to be configurable using a web API and by updating a local configuration on app start.
npm install
All configuration can be updated by modifying configuration in the config folder / config.json file
"host": "http://localhost", //updates the hosting location of this app
"port": "3000", //updates the port of this app optional
"fitbit": {
"clientId": "YOUR FITBIT CLIENT ID",
"clientSecret": "YOUR FITBIT CLIENT SECRET",
"apiVersion": "1.2",
"callbackRoute" :"/auth/fitbit/callback", //callback route for Fitbit
"authRoute": "/auth/fitbit", //initial authorization
"dataAuthorized": "activity heartrate location nutrition profile settings sleep social weight", //data you wish to authorize for a specific Fitbit source
"authorizationHTML": "Fitbit authorized!" //HTML shown on authorization screen
},
"poller":{
"enabled":true, //starts polling on app launch
"frequency": "3000", //frequency of polling
"routesPolled": [ //determines which time series data to poll for
{
"resourcePath":"activities/steps",
"date":"today",
"period":"1d"
}
],
"enableWebRoutes": true, //disables or enables access to web based polling control via web
"stopPollingRoute":"/polling/stop", //route for stopping the poller
"startPollingRoute":"/polling/start" //route for starting the poller
},
"kafka":{
"host": "http://localhost:9092" //route for default Kafka instance
},
"sources":{
"enableWebRoutes":true, //enable or disable visibility into source IDs and OAuth Tokens via web
"deleteSourceRoute":"/sources/delete",
"deactivateSourceRoute":"/sources/deactivate",
"listAllSourcesRoute":"/sources/list"
}
npm run start
https://localhost:3000/auth/fitbit
but this is configurable in the config.json file/polling/stop
/polling/start
/sources/list
/sources/delete?user={ADD FITBIT ID HERE}
/sources/deactivate?user={ADD FITBIT ID HERE}