An example Rails app using the FitbitAPI gem.
To interact with Fitbit's API, you must register your application at dev.fitbit.com. During registration, make sure the value for the Callback URL is the following:
http://localhost:3000/users/auth/fitbit/callback
After registering, you should have access to the application's Client ID and Client Secret values to use during setup below.
- Clone this repository.
- Run
bin/setup. - In the
.env.developmentfile, set theFITBIT_API_CLIENT_IDandFITBIT_API_CLIENT_SECRETvariables to the Client ID and Client Secret values for the application you registered with Fitbit. - Start the Rails server (
bin/rails s) and visithttp://localhost:3000. - On the login page, click on the "Sign in with Fitbit" button.