# Samsung Health

With Thryve you can easily integrate your application with Samsung Health. Thryve enables integration via the [new Samsung Health Data for Android](https://developer.samsung.com/health/data/overview.html) with SDK 5.2.0 onwards.

{% hint style="info" %}
To access data from Samsung Health using the `ThryveSamsungHealth` module, register your application with the Samsung Partner App Program. The Thryve SDK includes all necessary Samsung SDKs, eliminating the need for additional logic. Ensure your application ID is approved by Samsung for Samsung Health access. For more details, visit the [Samsung developer website](https://developer.samsung.com/health/android).
{% endhint %}

<figure><img src="/files/dPrSOMUln6Yqped3fArc" alt="" width="188"><figcaption></figcaption></figure>

### Data availability

#### Manually entered data

Data manually input by users into Samsung Health, such as Blood Pressure and Exercise, is no longer marked with the `"manual_entry"` [annotation](/thryve-product-overview/understand/data-annotations.md), as Samsung has removed this feature.

### Migration Guide

{% hint style="danger" %}
This section is relevant if you have used the Thryve Samsung Health module with Thryve SDK 5.1.2 or prior. If you are starting to integrate Samsung Health from scratch, please refer to the general integrate your mobile app section to understand how to [Setup the Thryve SDK,](/integrate-your-mobile-app/setup-thryve-sdk.md) [Connect data sources](/integrate-your-mobile-app/connect-data-sources.md) and [specifically use Samsung Health](/integrate-your-mobile-app/apple-health-health-connect-and-samsung-health.md).
{% endhint %}

Samsung is deprecating its old implementation of the Samsung Health Module. We strongly advise migrating your user base to the updated module.

**Important Considerations:**

* **Re-Authentication Required:** Existing users must re-authenticate Samsung Health on their devices due to the new API foundation. Thryve SDK accounts for that and `isActive` for Samsung Health will return `false` if we have a previous connection stored in backend (e.g. for previous integration) but the user has not authorized any types with the new SDK.
* **No Native Migration Options:** Samsung is not offering direct migration paths for current users.
* **Samsung approval required:** To use the new Samsung Health module in production, [request a partnership migration](https://developer.samsung.com/enroll/partner/SHealth/m48wvqi1mt9w2w4c/business) through your existing Samsung Developer account.

{% hint style="danger" %}
When migrating from the legacy Samsung Health Android SDK to the Samsung Health Data SDK, all apps - including those that were previously approved - must go through a new partner approval process using your existing Samsung Developer account. Approvals granted for the legacy SDK do not transfer to the Data SDK.
{% endhint %}

Both the legacy (`shealth`) and the new (`samsung_health`) Samsung Health modules are available with the same model names but different package names: `com.thryve.sdk.samsungHealth` and `com.thryve.sdk.samsung.health`, respectively.

To complete the migration, developers only need to update the imports of `ThryveSamsungHealthConfig` and `ThryveSamsungHealthDataType` to the new package, `com.thryve.sdk.samsung.health`.

{% hint style="warning" %}
Thryve SDK support for the old Samsung Health SDK for Android (`shealth`)has been deprecated as of 16th April, 2026. While Thryve SDK 5.2.0 still supports the Samsung Health SDK for Android via the module `shealth` the old implementation will be completely removed with Thryve SDK 5.3.0.
{% endhint %}

Follow these instructions to migrate from the deprecated old Thryve Samsung Health module to new Thryve Samsung Health module

#### **Step 1: Add the New Samsung Health Module Dependencies**

{% tabs %}
{% tab title="Thryve Maven Repo " %}

```groovy
dependencies {
    ...
    // new Samsung Health module dependency
    api("com.thryve.sdk:samsung_health:${thryve_sdk_version}")
    
    // old Samsung Health module dependency (we do not recommend to use this anymore)
    api("com.thryve.sdk:shealth:${thryve_sdk_version}")
}
```

{% endtab %}

{% tab title="AAR Libraries" %}

```groovy
dependencies {
    ...
    implementation(files("libs/thryve_module_samsung_health_${thryve_sdk_version}.aar")
    // dependency for compression
    implementation("com.github.luben:zstd-jni:$zstdVersion") {
         artifact { type = "aar" }
      }
    
    // dependency for new Samsung Data SDK 
    // skip this dependency if kotlin-parcelize is already added as a plugin(recommended)
    implementation ("org.jetbrains.kotlin:kotlin-parcelize-runtime:$kotlin")
    ...
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
If you are currently using the **old Thryve Samsung Health SDK**, it is strongly recommended to **remove it before integrating the new Samsung Health module** to avoid conflicts and ensure a clean migration.
{% endhint %}

#### **Step 2: Use the New Configuration Model**

Replace all deprecated Samsung Health configuration classes. Use the new ThryveSamsungHealthConfig and ThryveSamsungHealthDataType

```kotlin
import com.thryve.sdk.samsung.health.model.ThryveSamsungHealthConfig
import com.thryve.sdk.samsung.health.model.ThryveSamsungHealthDataType

val samsungHealthConfig = ThryveSamsungHealthConfig(
    dataTypes = ThryveSamsungHealthDataType.entries.toList(),
    enableBackgroundSync = true
)
```

{% hint style="warning" %}
Ensure you have new Samsung module in build gradle as stated in Step 1 and use the right imports package `com.thryve.sdk.samsung.health` not the deprecated package `com.thryve.sdk.samsungHealth`
{% endhint %}

With the new module, Samsung has adapted their data type classification. Please check this table for changes:

| shealth (old module) dataTypes | samsung\_health (new module) dataTypes | Note                                                                               |
| ------------------------------ | -------------------------------------- | ---------------------------------------------------------------------------------- |
| Not available                  | `ACTIVITY_SUMMARY`                     | Daily Data on total active time, ActiveBurnedCalories, BurnedCalories and Distance |
| `BLOOD_GLUCOSE`                | `BLOOD_GLUCOSE`                        |                                                                                    |
| `HBA1C`                        | Not available                          |                                                                                    |
| `OXYGEN_SATURATION`            | `BLOOD_OXYGEN`                         |                                                                                    |
| `BLOOD_PRESSURE`               | `BLOOD_PRESSURE`                       |                                                                                    |
| `WEIGHT`                       | `BODY_COMPOSITION`                     |                                                                                    |
| `BODY_MUSCLE`                  | Not available                          | Data available as part of `BODY_COMPOSITION`                                       |
| `BODY_FAT`                     | Not available                          | Data available as part of `BODY_COMPOSITION`                                       |
| `WAIST_CIRCUMFERENCE`          | Not available                          |                                                                                    |
| `BODY_TEMPERATURE`             | `BODY_TEMPERATURE`                     |                                                                                    |
| `EXERCISE`                     | `EXERCISE`                             |                                                                                    |
| `FLOORS_CLIMBED`               | `FLOORS_CLIMBED`                       |                                                                                    |
| `HEART_RATE`                   | `HEART_RATE`                           |                                                                                    |
| Not available                  | `SKIN_TEMPERATURE`                     |                                                                                    |
| `SLEEP`                        | `SLEEP`                                |                                                                                    |
| `SLEEP_STAGE`                  | Not available                          | Sleep stage data is now available as part of `SLEEP` dataType                      |
| `STEP_DAILY_TREND`             | `STEPS`                                | Daily-data only                                                                    |
| `STEP_COUNT`                   | Not available                          | Intraday step data is not available anymore.                                       |
| `WATER_INTAKE`                 | `WATER_INTAKE`                         |                                                                                    |
| `HEIGHT`                       | `USER_PROFILE`                         |                                                                                    |

#### **Step 3: Provide Samsung Health Configuration to SDK**

Pass the `ThryveSamsungHealthConfig` instance created in the previous step to all instances where `ThryveSDKConfig` is initialized or updated.

```kotlin
val thryveSDKConfig = ThryveSDKConfig(
    authId = "ASSIGNED_AUTH_ID",
    authSecret = "ASSIGNED_AUTH_SECRET",
    endUserAlias = "XXXXXXXXXXX",
    endUserId = null, 
    locale = "de",
    samsungHealthConfig = samsungHealthConfig
    //Add any other configs like ThryveHealthConnectConfig, ThryveShenAIConfig, etc which you are using
)

val thryveSDK = ThryveSDK.getOrCreate(thryveSDKConfig, context) { thryveResponse ->
       if(thryveResponse.successful){
           //ThyveSDK initialization processes completed successfully
       } else {
           // ThryveSDK initalization process failed. process the ThryveErrors for the specific reason.
           thryveResponse.errors.map { thryveError -> Logger.e(TAG){" getOrCreate ThryveError in onCreate function $thryveError"} }
       }
  }
 //Call updateSDKConfig only when you want to update the thryveSDKconfig
 thryveSDK?.updateSDKConfig(thryveSDKConfig)
```

#### Step 4: Re-authenticate User

Connect users to the new Samsung Health module by calling `thryveSDK.start()`

{% code overflow="wrap" %}

```kotlin
thryveSDK?.start(this, Source.SAMSUNG) { authorizeStartResponse ->
        Logger.i(TAG) { "Results for authorize and Start ${authorizeStartResponse.data}" }
    }
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thryve.health/thryve-data-sources/samsung-health.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
