Skip to content

FitSquad/googlefit-rest-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

googlefit-rest-utils

Utilities for Google Fit REST API

Install

npm i --save googlefit-rest-utils

Usage

Given

var activityData = {
 "dataSourceId": "derived:com.google.distance.delta:com.google.android.gms:pruned_distance",
 "point": [
 ...
 ]
};

var distanceData = {
 "dataSourceId": "derived:com.google.activity.segment:com.google.android.gms:merge_activity_segments",
 "point": [
 ...
 ]
};

When

  var gFitUtils = require('googlefit-rest-utils');
  var distanceByBucket = gFitUtils.bucketByActivityType(distanceData.point, activityData.point);

Then

   {
      '0': 345.123,
      '7': 123.35,
      ....
   }

About us

http://www.fitsquadapp.com