@flomentumsolutions/capacitor-health-extended

中文文档
0.9.5发布于 2026/11/05MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 3.1万

Capacitor plugin for Apple HealthKit and Google Health Connect Platform

原始使用文档
文档目录28 节
  1. Thanks and attribution
  2. Requirements (Plugin & Consuming Apps)
  3. Features
  4. Supported data types (parity iOS + Android)
  5. Install
  6. Setup Consuming Apps
  7. iOS
  8. Android
  9. iOS read-permission UX hint
  10. API
  11. isHealthAvailable()
  12. checkHealthPermissions(...)
  13. requestHealthPermissions(...)
  14. openAppleHealthSettings()
  15. openHealthConnectSettings()
  16. showHealthConnectInPlayStore()
  17. getCharacteristics(...)
  18. queryAggregated(...)
  19. queryWorkouts(...)
  20. queryLatestSample(...)
  21. queryWeight()
  22. queryHeight()
  23. queryHeartRate()
  24. querySteps()
  25. saveWorkout(...)
  26. saveMetrics(...)
  27. Interfaces
  28. Type Aliases

@flomentumsolutions/capacitor-health-extended

Cross‑platform Capacitor plugin for reading data from Apple HealthKit and Google Health Connect. The plugin requires Node.js 24+ and is compatible with Capacitor 8. For iOS the plugin ships a Swift Package Manager distribution (Capacitor 8 default), while the CocoaPods spec FlomentumsolutionsCapacitorHealthExtended remains for legacy projects.

Thanks and attribution

Forked from capacitor-health and as such...

Thanks @mley for the ground work. The goal of this fork is to extend functionality and datapoints and keep up with the ever-changing brand-new Android Health Connect Platform. I'm hoping to create platform parity for capacitor API-based health data access.

Requirements (Plugin & Consuming Apps)

  • Node.js 24+ (Latest LTS version is recommended)
  • Capacitor 8
  • iOS 15+ (Xcode 26 + HealthKit + SwiftPM toolchain)
  • Android 16+ (Android Studio Otter 2025.2.1 + Health Connect 1.2.0-alpha02 + Gradle 8.13.0 + Kotlin 2.2.20)

Features

  • Check if health functionality is available on the device
  • Request and verify health permissions
  • Query aggregated data like steps or calories
  • Retrieve workout sessions with optional route and heart rate data
  • Create workout sessions (e.g., rock climbing) with totals, optional routes, and heart-rate samples (write APIs)
  • Save manual metrics (weight, height, body fat %, resting heart rate) to HealthKit/Health Connect (write APIs)
  • Fetch the latest samples for steps, distance (incl. cycling), calories (active/total/basal), heart‑rate, resting HR, HRV, respiratory rate, blood pressure, oxygen saturation, blood glucose, body temperature (basal + core), body fat, height, weight, flights climbed, sleep (incl. REM duration), and exercise time.
  • Read profile characteristics on iOS: biological sex, blood type, date of birth, Fitzpatrick skin type, wheelchair use.

Supported data types (parity iOS + Android)

  • Activity: steps, distance, distance‑cycling, exercise time (Apple Exercise Time), workouts (with routes/steps/calories), flights climbed
  • Energy: active calories, total calories, basal calories
  • Vitals: heart rate, resting heart rate, HRV, respiratory rate, blood pressure, oxygen saturation, blood glucose, body temperature, basal body temperature
  • Body: weight, height, body fat
  • Characteristics (iOS): biological sex, blood type, date of birth, Fitzpatrick skin type, wheelchair use
  • Sessions: mindfulness, sleep, sleep REM (latest sample only)

Install

npm install @flomentumsolutions/capacitor-health-extended
npx cap sync

Setup Consuming Apps

iOS

Capacitor 8 resolves iOS plugins via SwiftPM. Running npx cap sync ios will add the FlomentumSolutionsCapacitorHealthExtended package (backed by capacitor-swift-pm) to your Xcode project. If you are pinned to Capacitor 7, you can keep using the CocoaPods spec FlomentumSolutionsCapacitorHealthExtended.

  • Make sure your app id has the 'HealthKit' entitlement when this plugin is installed (see iOS dev center).
  • Also, make sure your app and App Store description comply with the Apple review guidelines.
  • There are two keys to be added to the info.plist file: NSHealthShareUsageDescription and NSHealthUpdateUsageDescription.
  • Request WRITE_* permissions with requestHealthPermissions to enable saving workouts/energy/distance/routes/heart-rate samples and manual metrics (weight/height/body fat/resting HR) to HealthKit.

Android

The plugin namespace/package is com.flomentumsolutions.capacitorhealthextended.capacitor (hyphen removed from older com.flomentumsolutions.capacitor-health-extended references); use this when wiring activities, manifest entries, or ProGuard rules.

  • Android Manifest in root tag right after opening manifest tag
    <!-- Make Health Connect visible to detect installation -->
    <queries>
        <package android:name="com.google.android.apps.healthdata" />
    </queries>

    <!-- Declare permissions you’ll request -->
    <!-- READ permissions -->
    <uses-permission android:name="android.permission.health.READ_STEPS" />
    <uses-permission android:name="android.permission.health.READ_ACTIVE_CALORIES_BURNED" />
    <uses-permission android:name="android.permission.health.READ_TOTAL_CALORIES_BURNED" />
    <uses-permission android:name="android.permission.health.READ_DISTANCE" />
    <uses-permission android:name="android.permission.health.READ_EXERCISE" />
    <uses-permission android:name="android.permission.health.READ_EXERCISE_ROUTES" />
    <uses-permission android:name="android.permission.health.READ_HEART_RATE" />
    <uses-permission android:name="android.permission.health.READ_WEIGHT" />
    <uses-permission android:name="android.permission.health.READ_HEIGHT" />
    <uses-permission android:name="android.permission.health.READ_HEART_RATE_VARIABILITY" />
    <uses-permission android:name="android.permission.health.READ_BLOOD_PRESSURE" />
    <uses-permission android:name="android.permission.health.READ_MINDFULNESS" />
    <uses-permission android:name="android.permission.health.READ_RESTING_HEART_RATE" />
    <uses-permission android:name="android.permission.health.READ_RESPIRATORY_RATE" />
    <uses-permission android:name="android.permission.health.READ_OXYGEN_SATURATION" />
    <uses-permission android:name="android.permission.health.READ_BLOOD_GLUCOSE" />
    <uses-permission android:name="android.permission.health.READ_BODY_TEMPERATURE" />
    <uses-permission android:name="android.permission.health.READ_BASAL_BODY_TEMPERATURE" />
    <uses-permission android:name="android.permission.health.READ_BODY_FAT" />
    <uses-permission android:name="android.permission.health.READ_FLOORS_CLIMBED" />
    <uses-permission android:name="android.permission.health.READ_BASAL_METABOLIC_RATE" />
    <uses-permission android:name="android.permission.health.READ_SLEEP" />
    <!-- WRITE permissions -->
    <uses-permission android:name="android.permission.health.WRITE_EXERCISE" />
    <uses-permission android:name="android.permission.health.WRITE_ACTIVE_CALORIES_BURNED" />
    <uses-permission android:name="android.permission.health.WRITE_TOTAL_CALORIES_BURNED" />
    <uses-permission android:name="android.permission.health.WRITE_DISTANCE" />
    <uses-permission android:name="android.permission.health.WRITE_HEART_RATE" />
    <uses-permission android:name="android.permission.health.WRITE_EXERCISE_ROUTE" />
    <uses-permission android:name="android.permission.health.WRITE_WEIGHT" />
    <uses-permission android:name="android.permission.health.WRITE_HEIGHT" />
    <uses-permission android:name="android.permission.health.WRITE_BODY_FAT" />
    <uses-permission android:name="android.permission.health.WRITE_RESTING_HEART_RATE" />

Include the WRITE_* entries when you call saveWorkout to insert exercise sessions, energy, distance, routes, or heart rate samples, and add the metric write permissions when using saveMetrics.

  • Android Manifest in application tag
    <!-- Handle Health Connect rationale (Android 13-) -->
    <!-- REPLACE com.my.app with your details -->
    <activity
        android:name="com.my.app.PermissionsRationaleActivity" 
        android:exported="true">
        <intent-filter>
            <action android:name="androidx.health.ACTION_SHOW_PERMISSIONS_RATIONALE"/>
            <category android:name="android.intent.category.HEALTH_PERMISSIONS"/>
        </intent-filter>
    </activity>

    <!-- Handle Android 14+ alias -->
    <!-- REPLACE com.my.app with your details -->
    <activity-alias
        android:name="ViewPermissionUsageActivity"
        android:exported="true"
        android:targetActivity="com.my.app.PermissionsRationaleActivity"
        android:permission="android.permission.START_VIEW_PERMISSION_USAGE">
        <intent-filter>
            <action android:name="android.intent.action.VIEW_PERMISSION_USAGE"/>
            <category android:name="android.intent.category.HEALTH_PERMISSIONS"/>
        </intent-filter>
    </activity-alias>
  • Android Manifest in application tag for secure WebView content
    <!-- Configure secure WebView and allow HTTPS loading -->
    <application
        android:usesCleartextTraffic="false"
        android:networkSecurityConfig="@xml/network_security_config">
        ...
    </application>
  • Create com.my.app.PermissionsRationaleActivity.kt with (REPLACE com.my.app with your details):
<!-- REPLACE com.my.app with your details -->
package com.my.app

import android.os.Bundle
import android.util.Log
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.activity.addCallback
import androidx.appcompat.app.AppCompatActivity

class PermissionsRationaleActivity : AppCompatActivity() {
    private lateinit var webView: WebView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        supportActionBar?.apply {
            title = "Privacy Policy"
            setDisplayHomeAsUpEnabled(true)
        }

        webView = WebView(this).apply {
            settings.apply {
                javaScriptEnabled = true
                domStorageEnabled = true
                useWideViewPort = true
                loadWithOverviewMode = true
            }
            webChromeClient = WebChromeClient()
            webViewClient = object : WebViewClient() {
                override fun shouldOverrideUrlLoading(view: WebView, request: android.webkit.WebResourceRequest) = false
                override fun onReceivedError(
                    view: WebView,
                    request: android.webkit.WebResourceRequest,
                    error: android.webkit.WebResourceError
                ) {
                    Log.e("WebView", "Failed to load: ${error.description}")
                }
                override fun onPageFinished(view: WebView, url: String) {
                    Log.d("WebView", "Loaded: $url")
                }
            }
            loadUrl("https://mywebsite.com/privacy-policy")
        }

        setContentView(webView)

        // Device back button behavior
        onBackPressedDispatcher.addCallback(this) {
            finish()
        }
    }

    // Toolbar Up button behavior
    override fun onSupportNavigateUp(): Boolean {
        finish()
        return true
    }
}
  • Create res/xml/network_security_config.xml with:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <base-config cleartextTrafficPermitted="false">
    <trust-anchors>
      <certificates src="system"/>
    </trust-anchors>
  </base-config>
</network-security-config>

This setup ensures your WebView will load HTTPS content securely and complies with Android's default network security policy.

iOS read-permission UX hint

On iOS, checkHealthPermissions is optimistic for read sample permissions because HealthKit does not distinguish denied access from empty data. If a query returns no results, prompt the user to verify Apple Health settings.

import { Health, type HealthPermission } from '@flomentumsolutions/capacitor-health-extended';

const NO_DATA_HINT =
  'No data found. If you believe this is an error, please verify your settings in Apple Health.';

export async function queryWithHealthEmptyHint<T>(
  permission: HealthPermission,
  query: () => Promise<T>,
  isEmpty: (result: T) => boolean,
  showHint: (message: string) => void
): Promise<T | null> {
  const { permissions } = await Health.checkHealthPermissions({ permissions: [permission] });
  if (!permissions[permission]) {
    return null;
  }

  const result = await query();

  if (isEmpty(result)) {
    showHint(NO_DATA_HINT);
  }

  return result;
}

API

<docgen-index>

* [`isHealthAvailable()`](#ishealthavailable)
* [`checkHealthPermissions(...)`](#checkhealthpermissions)
* [`requestHealthPermissions(...)`](#requesthealthpermissions)
* [`openAppleHealthSettings()`](#openapplehealthsettings)
* [`openHealthConnectSettings()`](#openhealthconnectsettings)
* [`showHealthConnectInPlayStore()`](#showhealthconnectinplaystore)
* [`getCharacteristics(...)`](#getcharacteristics)
* [`queryAggregated(...)`](#queryaggregated)
* [`queryWorkouts(...)`](#queryworkouts)
* [`queryLatestSample(...)`](#querylatestsample)
* [`queryWeight()`](#queryweight)
* [`queryHeight()`](#queryheight)
* [`queryHeartRate()`](#queryheartrate)
* [`querySteps()`](#querysteps)
* [`saveWorkout(...)`](#saveworkout)
* [`saveMetrics(...)`](#savemetrics)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

isHealthAvailable()

isHealthAvailable() => Promise<{ available: boolean; }>

Checks if health API is available. Android: If false is returned, the Google Health Connect app is probably not installed. See showHealthConnectInPlayStore()

Returns: Promise<{ available: boolean; }>


checkHealthPermissions(...)

checkHealthPermissions(permissions: PermissionsRequest) => Promise<PermissionResponse>

Returns whether each permission is granted. Android: Uses Health Connect grant state. iOS: Write permissions are strict. Read permissions for sample types are optimistic because HealthKit does not distinguish denied vs no data; this returns false only when the read permission is not determined. For characteristics, this probes access and returns false when denied. UX tip: If this returns true but a query yields no results, show a hint to check Apple Health settings.

ParamTypeDescription
permissionsPermissionsRequestpermissions to query

Returns: Promise<PermissionResponse>


requestHealthPermissions(...)

requestHealthPermissions(permissions: PermissionsRequest) => Promise<PermissionResponse>

Requests the permissions from the user.

Android: Apps can ask only a few times for permissions, after that the user has to grant them manually in the Health Connect app. See openHealthConnectSettings()

iOS: If the permissions are already granted or denied, this method will just return without asking the user. In iOS we can't really detect if a user granted or denied a permission. The return value reflects the assumption that all permissions were granted.

ParamTypeDescription
permissionsPermissionsRequestpermissions to request

Returns: Promise<PermissionResponse>


openAppleHealthSettings()

openAppleHealthSettings() => Promise<void>

Opens the apps settings, which is kind of wrong, because health permissions are configured under: Settings > Apps > (Apple) Health > Access and Devices > [app-name] But we can't go there directly.


openHealthConnectSettings()

openHealthConnectSettings() => Promise<void>

Opens the Google Health Connect app iOS: Aliases openAppleHealthSettings().


showHealthConnectInPlayStore()

showHealthConnectInPlayStore() => Promise<void>

Opens the Google Health Connect app in PlayStore iOS: Resolves without action.


getCharacteristics(...)

getCharacteristics(request?: CharacteristicsRequest | undefined) => Promise<CharacteristicsResponse>

iOS only: Reads user characteristics such as biological sex, blood type, date of birth, Fitzpatrick skin type, and wheelchair use. Values are null when unavailable or permission was not granted. Android does not expose these characteristics; it returns platformSupported: false and a platformMessage for UI hints without emitting null values.

Passing fields lets you request only specific characteristics (e.g., date of birth) to keep permissions scoped narrowly. Defaults to all characteristics when omitted.

ParamType
requestCharacteristicsRequest

Returns: Promise<CharacteristicsResponse>


queryAggregated(...)

queryAggregated(request: QueryAggregatedRequest) => Promise<QueryAggregatedResponse>

Query aggregated data

  • Blood-pressure aggregates return the systolic average in value plus systolic, diastolic, and unit.
  • total-calories is derived as active + basal energy on both iOS and Android for latest samples, aggregated queries, and workouts. We fall back to the platform's total‑calories metric (or active calories) when basal data isn't available or permission is missing. Request both READ_ACTIVE_CALORIES and READ_BASAL_CALORIES for full totals.
  • Weight/height aggregation returns the latest sample per day (no averaging).
  • Android aggregation currently supports daily buckets; unsupported buckets will be rejected.
  • Android distance-cycling aggregates distance recorded during biking exercise sessions (requires distance + workouts permissions).
  • Daily bucket: "day" queries use calendar-day boundaries in the device time zone (start-of-day through the next start-of-day) instead of a trailing 24-hour window. For “today,” send startDate at today’s start-of-day and endDate at now or tomorrow’s start-of-day.
ParamType
requestQueryAggregatedRequest

Returns: Promise<QueryAggregatedResponse>


queryWorkouts(...)

queryWorkouts(request: QueryWorkoutRequest) => Promise<QueryWorkoutResponse>

Query workouts

ParamType
requestQueryWorkoutRequest

Returns: Promise<QueryWorkoutResponse>


queryLatestSample(...)

queryLatestSample(request: { dataType: LatestDataType; }) => Promise<QueryLatestSampleResponse>

Query latest sample for a specific data type

  • Latest sleep sample returns the most recent complete sleep session (asleep states only) from the last ~36 hours; if a longer overnight session exists, shorter naps are ignored.
  • sleep-rem returns REM duration (minutes) for the latest sleep session; requires iOS 16+ sleep stages and Health Connect REM data on Android.
ParamType
request{ dataType: LatestDataType; }

Returns: Promise<QueryLatestSampleResponse>


queryWeight()

queryWeight() => Promise<QueryLatestSampleResponse>

Query latest weight sample Convenience wrapper around queryLatestSample({ dataType: 'weight' }).

Returns: Promise<QueryLatestSampleResponse>


queryHeight()

queryHeight() => Promise<QueryLatestSampleResponse>

Query latest height sample Convenience wrapper around queryLatestSample({ dataType: 'height' }).

Returns: Promise<QueryLatestSampleResponse>


queryHeartRate()

queryHeartRate() => Promise<QueryLatestSampleResponse>

Query latest heart rate sample Convenience wrapper around queryLatestSample({ dataType: 'heart-rate' }).

Returns: Promise<QueryLatestSampleResponse>


querySteps()

querySteps() => Promise<QueryLatestSampleResponse>

Query latest steps sample Convenience wrapper around queryLatestSample({ dataType: 'steps' }).

Returns: Promise<QueryLatestSampleResponse>


saveWorkout(...)

saveWorkout(request: SaveWorkoutRequest) => Promise<SaveWorkoutResponse>

Create a workout session with optional totals and route/heart-rate samples.

  • iOS stores an HKWorkout (activityType mapped from activityType) with total energy/distance and optional metadata/route/heart-rate samples.
  • Android stores an ExerciseSessionRecord plus ActiveCaloriesBurnedRecord, DistanceRecord, and HeartRateRecord when provided. Routes are attached via ExerciseRoute.
  • Requires matching WRITE_* permissions for the values you include (e.g., WRITE_WORKOUTS + WRITE_ACTIVE_CALORIES + WRITE_DISTANCE + WRITE_HEART_RATE + WRITE_ROUTE).
ParamType
requestSaveWorkoutRequest

Returns: Promise<SaveWorkoutResponse>


saveMetrics(...)

saveMetrics(request: SaveMetricsRequest) => Promise<SaveMetricsResponse>

Save user-provided body metrics to the health platform. iOS: Requests read access for the same metric types when writing to preserve read permissions.

ParamType
requestSaveMetricsRequest

Returns: Promise<SaveMetricsResponse>


Interfaces

PermissionResponse

PropType
permissionsRecord<HealthPermission, boolean>

PermissionsRequest

PropType
permissionsHealthPermission[]

CharacteristicsResponse

PropTypeDescription
biologicalSexHealthBiologicalSex | null
bloodTypeHealthBloodType | null
dateOfBirthstring | null
fitzpatrickSkinTypeHealthFitzpatrickSkinType | null
wheelchairUseHealthWheelchairUse | null
platformSupportedbooleanIndicates whether the platform exposes these characteristics via the plugin (true on iOS, false on Android).
platformMessagestringOptional platform-specific message; on Android we return a user-facing note explaining that values remain empty unless synced from iOS.

CharacteristicsRequest

PropTypeDescription
fieldsCharacteristicField[]Characteristics to query. Defaults to all characteristics when omitted.

QueryAggregatedResponse

PropType
aggregatedDataAggregatedSample[]

AggregatedSample

PropType
startDatestring
endDatestring
valuenumber
systolicnumber
diastolicnumber
unitstring

QueryAggregatedRequest

PropType
startDatestring
endDatestring
dataType'steps' | 'active-calories' | 'total-calories' | 'basal-calories' | 'distance' | 'weight' | 'height' | 'heart-rate' | 'resting-heart-rate' | 'respiratory-rate' | 'oxygen-saturation' | 'blood-glucose' | 'body-temperature' | 'basal-body-temperature' | 'body-fat' | 'flights-climbed' | 'exercise-time' | 'distance-cycling' | 'mindfulness' | 'sleep' | 'hrv' | 'blood-pressure'
bucketstring

QueryWorkoutResponse

PropType
workoutsWorkout[]
errorsRecord<string, string>

Workout

PropType
startDatestring
endDatestring
workoutTypestring
sourceNamestring
idstring
durationnumber
distancenumber
stepsnumber
caloriesnumber
sourceBundleIdstring
routeRouteSample[]
heartRateHeartRateSample[]

RouteSample

PropType
timestampstring
latnumber
lngnumber
altnumber

HeartRateSample

PropType
timestampstring
bpmnumber

QueryWorkoutRequest

PropType
startDatestring
endDatestring
includeHeartRateboolean
includeRouteboolean
includeStepsboolean

QueryLatestSampleResponse

PropType
valuenumber
systolicnumber
diastolicnumber
timestampnumber
endTimestampnumber
unitstring
metadataRecord<string, unknown>

SaveWorkoutResponse

PropType
successboolean
idstring

SaveWorkoutRequest

PropType
activityTypeWorkoutActivityType
startDatestring
endDatestring
caloriesnumber
distancenumber
metadataRecord<string, any>
routeRouteSample[]
heartRateSamplesHeartRateSample[]

SaveMetricsResponse

PropType
successboolean
insertednumber

SaveMetricsRequest

PropType
weightKgnumber
heightCmnumber
bodyFatPercentnumber
restingHeartRatenumber

Type Aliases

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

HealthPermission

'READ_STEPS' | 'READ_WORKOUTS' | 'WRITE_WORKOUTS' | 'READ_ACTIVE_CALORIES' | 'WRITE_ACTIVE_CALORIES' | 'READ_TOTAL_CALORIES' | 'WRITE_TOTAL_CALORIES' | 'READ_DISTANCE' | 'WRITE_DISTANCE' | 'READ_WEIGHT' | 'WRITE_WEIGHT' | 'READ_HEIGHT' | 'WRITE_HEIGHT' | 'READ_HEART_RATE' | 'WRITE_HEART_RATE' | 'READ_RESTING_HEART_RATE' | 'WRITE_RESTING_HEART_RATE' | 'READ_ROUTE' | 'WRITE_ROUTE' | 'READ_MINDFULNESS' | 'READ_HRV' | 'READ_BLOOD_PRESSURE' | 'READ_BASAL_CALORIES' | 'READ_RESPIRATORY_RATE' | 'READ_OXYGEN_SATURATION' | 'READ_BLOOD_GLUCOSE' | 'READ_BODY_TEMPERATURE' | 'READ_BASAL_BODY_TEMPERATURE' | 'READ_BODY_FAT' | 'WRITE_BODY_FAT' | 'READ_FLOORS_CLIMBED' | 'READ_SLEEP' | 'READ_EXERCISE_TIME' | 'READ_BIOLOGICAL_SEX' | 'READ_BLOOD_TYPE' | 'READ_DATE_OF_BIRTH' | 'READ_FITZPATRICK_SKIN_TYPE' | 'READ_WHEELCHAIR_USE'

HealthBiologicalSex

'female' | 'male' | 'other' | 'not_set' | 'unknown'

HealthBloodType

'a-positive' | 'a-negative' | 'b-positive' | 'b-negative' | 'ab-positive' | 'ab-negative' | 'o-positive' | 'o-negative' | 'not_set' | 'unknown'

HealthFitzpatrickSkinType

'type1' | 'type2' | 'type3' | 'type4' | 'type5' | 'type6' | 'not_set' | 'unknown'

HealthWheelchairUse

'wheelchair_user' | 'not_wheelchair_user' | 'not_set' | 'unknown'

CharacteristicField

'biologicalSex' | 'bloodType' | 'dateOfBirth' | 'fitzpatrickSkinType' | 'wheelchairUse'

LatestDataType

'steps' | 'active-calories' | 'total-calories' | 'basal-calories' | 'distance' | 'weight' | 'height' | 'heart-rate' | 'resting-heart-rate' | 'respiratory-rate' | 'oxygen-saturation' | 'blood-glucose' | 'body-temperature' | 'basal-body-temperature' | 'body-fat' | 'flights-climbed' | 'exercise-time' | 'distance-cycling' | 'mindfulness' | 'sleep' | 'sleep-rem' | 'hrv' | 'blood-pressure'

WorkoutActivityType

'rock-climbing' | 'climbing' | 'hiking' | 'running' | 'walking' | 'cycling' | 'biking' | 'strength-training' | 'yoga' | 'other'

版本与发布记录

@flomentumsolutions/capacitor-health-extended 共发布 45 个版本,首次发布于 2025/06/17;过去 12 个月发布了 26 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.5latest2026/11/0510 天前
0.9.42026/11/0510 天前
0.9.22026/11/0510 天前
0.8.32026/02/069 个月前
0.8.22026/01/189 个月前
0.8.12026/01/1410 个月前

关于 @flomentumsolutions/capacitor-health-extended 的常见问题

@flomentumsolutions/capacitor-health-extended 是什么?

Capacitor plugin for Apple HealthKit and Google Health Connect Platform

如何安装 @flomentumsolutions/capacitor-health-extended?

在项目目录运行 npm install @flomentumsolutions/capacitor-health-extended,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(>=9.0.0-beta.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@flomentumsolutions/capacitor-health-extended 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@flomentumsolutions/capacitor-health-extended 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@flomentumsolutions/capacitor-health-extended 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@flomentumsolutions/capacitor-health-extended 可以商用吗?

@flomentumsolutions/capacitor-health-extended 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@flomentumsolutions/capacitor-health-extended 的下载量有多少?

根据 npm 官方下载统计,@flomentumsolutions/capacitor-health-extended 在 2026/10/15 – 2026/11/13 这 30 天内被下载 31,457 次,日均约 1,049 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@flomentumsolutions/capacitor-health-extended 还在维护吗?

最新版本 0.9.5 发布于 2026/11/05(10 天前);至今共发布 45 个版本,其中过去 12 个月发布了 26 个;首次发布于 2025/06/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。