<a id="fitbit"></a>

# Fitbit

<a id="backend-classes"></a>

## Backend classes

For Django, choose from these class paths for `AUTHENTICATION_BACKENDS`.
For other integrations, use the same class paths in the
framework-specific backend setting.

| Backend name   | Class path                                 |
|----------------|--------------------------------------------|
| `fitbit`       | `social_core.backends.fitbit.FitbitOAuth1` |
| `fitbit`       | `social_core.backends.fitbit.FitbitOAuth2` |

Fitbit supports both OAuth 2.0 and OAuth 1.0a logins. OAuth 2 is
preferred for new integrations, as OAuth 1.0a does not support getting
heartrate or location and will be deprecated in the future.

1. Register a new OAuth Consumer [here](https://dev.fitbit.com/apps/new)
2. Configure the appropriate settings for OAuth 2.0 or OAuth 1.0a (see
   below).

<a id="oauth-2-0-or-oauth-1-0a"></a>

## OAuth 2.0 or OAuth 1.0a

- Fill `Consumer Key` and `Consumer Secret` values in the
  settings:
  ```default
  SOCIAL_AUTH_FITBIT_KEY = '<your-consumer-key>'
  SOCIAL_AUTH_FITBIT_SECRET = '<your-consumer-secret>'
  ```

<a id="oauth-2-0-specific-settings"></a>

## OAuth 2.0 specific settings

By default, only the `profile` scope is requested. To request more
scopes, set SOCIAL_AUTH_FITBIT_SCOPE:

```default
SOCIAL_AUTH_FITBIT_SCOPE = [
  'activity',
  'heartrate',
  'location',
  'nutrition',
  'profile',
  'settings',
  'sleep',
  'social',
  'weight'
]
```

The above will request all permissions from the user.
