OAuth 2.0 Libraries and Sample Code
chevron down
 

OAuth 2.0 Libraries and Sample Code

WARNING: Fitbit does not recommend or endorse any of these links. Use at your own risk.

OAuth 2.0 Libraries

The Fitbit Web API is a common implementation of the OAuth 2.0 specification. You don't need a Fitbit-specific library to use the Fitbit Web API. Instead, we recommend that you use the best OAuth 2.0 or HTTP client library available for your platform. If you don't have a favorite OAuth 2.0 or HTTP library yet, we’ve listed some below that people have told us worked for them. If we don’t have your favorite listed, tell us on the forum.

These libraries may contain sample code to get your started. We’ve included other sample code and tutorials below.

C# (.NET) Fitbit.NET by Aaron Coleman - https://github.com/aarondcoleman/Fitbit.NET
Java ScribeJava - https://github.com/scribejava/scribejava
JavaScript for Node.js bell for hapi.js has Fitbit as a built-in provider - https://www.npmjs.com/package/bell
Fitbit strategy for Passport - https://www.npmjs.com/package/passport-fitbit-oauth2
PHP Fitbit provider for PHP League’s OAuth 2.0 client - https://github.com/djchen/oauth2-fitbit
Python python-fitbit by Orcas - https://github.com/orcasgit/python-fitbit
R fitbitr by Nagi Teramo - https://github.com/teramonagi/fitbitr
Unity UnityFitbit by Travis Evashkevich - https://github.com/TravisEvashkevich/UnityFitbit
Others can be found here https://oauth.net/code/#client-libraries

Sample Code

Many of the OAuth 2.0 libraries provide sample code. We've provided some additional samples below. Also, there are plenty of other code examples that our developer communioty has created which can be found through internet searches.

Fitbit's Device SDK https://dev.fitbit.com/build/tutorials/examples/#web-api-oauth
Javascript for Web Browsers fitbit-web-demo by Jeremiah Lee (2016) - https://github.com/jeremiahlee/fitbit-web-demo
Node.js fitbit-hapi-demo by Jeremiah Lee (2015) - https://github.com/jeremiahlee/fitbit-hapi-demo
Python Fitbit API Access Using OAuth 2.0 and Raspberry Pi (January 2016) - http://pdwhomeautomation.blogspot.com/2016/01/fitbit-api-access-using-oauth20-and.html