> 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/connecting/apple-health-health-connect-and-mobile-sdk/sdk-provider-needs-deeplink-initconnection.md).

# Why is user\_id None for Apple Health in the widget?

SDK-based providers (Apple Health, Samsung Health, Health Connect) **cannot complete a connection through the web widget alone**, which is why the widget returns a null `user_id` for them. The user is only created on-device when `initConnection` runs. Apple Health has no web API and cannot be connected from a pure web app.

The unified pattern:

{% stepper %}
{% step %}
Set `auth_success_redirect_url` to a deep link or universal link into your app.
{% endstep %}

{% step %}
When the redirect's `resource` indicates an SDK provider, **call `initConnection`** (iOS / Flutter / React Native SDK) to prompt HealthKit permissions and finish the link.
{% endstep %}

{% step %}
API providers connect fully in the [widget](https://docs.tryterra.co/health-and-fitness-api/user-authentication/implementation-terra-widget).
{% endstep %}
{% endstepper %}

Data then flows to your webhooks and API as usual.

These providers appear in the widget because they are enabled in your dashboard. There is no self-serve setting to hide them, so to avoid showing them, split users into separate web vs mobile connection paths and present only platform-appropriate providers. See [customising authentication redirects](https://docs.tryterra.co/health-and-fitness-api/user-authentication/customising-authentication-redirects) for the redirect setup.
