> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/faq/help-topics/data-api-sdk/mobile-sdk-setup-permissions-and-crashes/mobile-only-sources-need-sdk-not-web-or-rest.md).

# Can I connect Apple Health from a web app?

Apple Health, Samsung Health, Health Connect, and Google Fit (via Health Connect) are **on-device,** [**mobile-only sources**](https://docs.tryterra.co/health-and-fitness-api/mobile-only-sources) **with no web API**. They can only be connected through the Terra mobile SDK embedded in a native app (iOS, Android, Flutter, React Native). They do not support REST API data requests, the web widget alone, or a standalone companion app.

All other wearables (Garmin, Fitbit, Oura, Polar, Whoop, etc.) have web APIs and should be integrated through Terra's [Health and Fitness API](https://docs.tryterra.co/health-and-fitness-api/getting-started) from your backend, with the [widget](https://docs.tryterra.co/health-and-fitness-api/user-authentication/implementation-terra-widget) handling user auth. Enable them in the dashboard, no mobile config needed. (`API + SDK` on the dashboard means a provider is reachable through one of those two paths, not both.)

The widget can present mobile-only sources but cannot complete the connection. When a user picks Apple or Samsung Health it redirects back to your app via `auth_success_redirect_url`. Showing 'success' and returning is expected, not a failure, and a null `user_id` in the callback means the SDK step has not run yet.

To finish the connection:

{% stepper %}
{% step %}
Detect the resource in the callback (e.g. `resource=APPLE`).
{% endstep %}

{% step %}
**Call the mobile SDK's `initConnection()`** to trigger the native permissions flow and create the user.
{% endstep %}

{% step %}
Retrieve data via the SDK's data functions (`getDaily`, `getBody`, `getSleep`, etc.).
{% endstep %}
{% endstepper %}

A 'not connected to Health Connect' error appears when REST is attempted against a mobile-only connection. For Android deep-link redirects, add an intent-filter with your custom scheme (matching `auth_success_redirect_url`) to the main activity and wire the React Native Linking API (`getInitialURL` plus a `url` event subscription).
