You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal aims to integrate Fitbit step count data with the Reclaim Protocol for use within the Catoff platform. By leveraging Fitbit's OAuth 2.0 authorization and step count API, we can create zero-knowledge proofs of users' walking activities, enabling innovative fitness-based challenges and wagers on the Catoff platform.
External APIs Needed
Fitbit OAuth 2.0 API
Fitbit Activities API (specifically, the step count endpoint)
Use Cases
Daily Step Challenge: Users can create or participate in challenges to reach a certain number of steps per day, with wagers based on achieving the goal.
Weekly Fitness Competition: Groups can compete for the highest total step count over a week, with automated payouts to the winners.
Data Provider
Name: Fitbit
Hash Value: [To be provided by Reclaim Protocol]
Code Snippet
constaxios=require('axios')const{ ReclaimServiceResponse }=require('../utils/reclaimServiceResponse')exports.processFitbitStepsData=async(proof,providerName)=>{constfitbitUserId=JSON.parse(proof[0].claimData.context).extractedParameters.userIdconstlastUpdateTimeStamp=proof[0].claimData.timestampSconststepCount=awaitgetUserSteps(fitbitUserId,accessToken)returnnewReclaimServiceResponse(providerName,lastUpdateTimeStamp,fitbitUserId,stepCount,proof[0])}constgetUserSteps=async(userId,accessToken)=>{consttoday=newDate().toISOString().split('T')[0]consturl=`https://api.fitbit.com/1/user/${userId}/activities/steps/date/today/1d.json`try{constresponse=awaitaxios.get(url,{headers: {Authorization: `Bearer ${accessToken}`,},})conststepData=response.data['activities-steps'][0]console.log(`Total steps for ${userId} on ${today}: ${stepData.value}`)returnparseInt(stepData.value,10)}catch(error){console.error('Error fetching Fitbit step data:',error.message)throwerror}}}
The text was updated successfully, but these errors were encountered:
Title
Fitbit Steps Integration for Reclaim Protocol
Introduction
This proposal aims to integrate Fitbit step count data with the Reclaim Protocol for use within the Catoff platform. By leveraging Fitbit's OAuth 2.0 authorization and step count API, we can create zero-knowledge proofs of users' walking activities, enabling innovative fitness-based challenges and wagers on the Catoff platform.
External APIs Needed
Use Cases
Data Provider
Code Snippet
The text was updated successfully, but these errors were encountered: