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.development
file, set theFITBIT_API_CLIENT_ID
andFITBIT_API_CLIENT_SECRET
variables 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.